Deactivating a filter applied to a card in POWER BI - filter

Rank Turnover =
RANKX(
ALL(Regions[Region]),
CALCULATE([Sales Total],KEEPFILTERS(Sales[Currency]="EUR"))
)
Hi everyone, got stuck with this one for the second day in a row. There are 3 tables in a dataset (Regions, Sales and Currency). Regions and Currency are filtering out the Dashboard when applied. My Intention is to have Total Sales in a Card for EUR only for a Chosen in a Region Filter Country. Everything works fine, but whenever I choose "LC" (Local Currency) in Currency Filter, the numbers Change - I Need to overcome that. Changing LC in that Filter should not affect Total Sales, they have to still be done in EUR.
Any help will be appreciated,
Thank you

Rank Sales EUR =
RANKX(
ALL(Regions[Region]),
CALCULATETABLE(
{[Sales Total]},
TREATAS({"EUR"}, 'Dashboard Currency'[Currency]),FILTER(Dates, Dates[Year]=MAX([Year]))))
Here is the answer. Thank you all for support

Related

How do I Filter a Measure in a Graph in Power Bi based on a date

i have a bar Chart in Power Bi , where i want filter a certain Measure based on a Date.
It only should shown for every month who is not after than a certian date.
In my example its the end of June
i tried with Measures but it gives too much before.
Total Sales Filtered = CALCULATE([Total Sales],FILTER('Date','Date'[Date]<MAX(ClosedMonthsDates[Date])))
Where is my Mistake?
Nevermind, i figured out i just forget the equal ^^
Total Sales Filtered = CALCULATE([Total Sales],FILTER('Date','Date'[Date]<=MAX(ClosedMonthsDates[Date])))

Advanced Filter on PowerQuery

Question
I am trying to filter some excel data I have on PowerQuery but am really struggling to figure out the best way to do this. On Excel I would usually do this using an Advanced Filter but I don't believe Power Query has the same functionality.
I would like to filter across a number of columns, using an OR condition for a:
a range of values in some columns; and
a range of 'wild card' searches in other columns
Example
As an example if my dataset is as below
Name
Function
Sub-Function
Position
Country
Andy
Sales
Omni-Channel
Sales Manager
Brazil
Bob
Marketing
eCommerce
Web Design
Argentina
Rakesh
HR
Business Partnering
HRBP
Italy
Tom
Finance
Reporting
Finance Manager
UK
Chris
Sales
Trade Marketing
Sales support
US
Raj
Legal
Legal
Para-legal
Brazil
I might want to filter for anyone meeting the following criteria;
working in the sales function OR
working in the Trade Marketing or Omni-Channel sub-function OR
has the words 'Manager' or 'Sales' in their Position title OR
is based in Brazil
The desired output would then be
Name
Function
Sub-Function
Position
Country
Andy
Sales
Omni-Channel
Sales Manager
Brazil
Tom
Finance
Reporting
Finance Manager
UK
Chris
Sales
Trade Marketing
Sales support
US
Raj
Legal
Legal
Para-legal
Brazil
My current approach
My approach was to create a table which had all my criteria (not including the 'wild card' searches), upload to PowerQuery, create multiple lists from this table (called for example Filter1, Filter2 etc..). Then using the following formula against my main dataset
= Table.SelectRows(#"Filtered Rows1", each (List.Contains(Filter1,[Function]) = true) or (List.Contains(Filter2,[Sub-Function]) = true) or (List.Contains(Filter3,[Country]) = true) or Text.Contains([Position], "Manager") or Text.Contains([Position], "Sales"))
Issues
The formula above works for really small data sets however not on my 80,000 line data set, or rather it does not work within a reasonable time frame
I have a long list of 'wild card' searches which apply to three columns so typing in the Text.Contain(...... etc.. formula multiple times into the formula seems very inefficient, is prone to mistakes and is not dynamic in any way.
I'm sure there must be a better way to do this but I have not found many helpful discussions or tutorials on this online so am reaching out to the community.
Thank you
I think the part of the problem the query is slow as with your current approach, filtering is evaluating filtering conditions separately before it could filter. Power bi is capable of handling filter on multiple columns in a single filter, like following
Table.SelectRows(
#"Changed Type1",
each ([Function] = "Sales")
or ([#"Sub-Function"] = "Trade Marketing" or [#"Sub-Function"] = "Omni-Channel")
or (
Text.Contains([Position], "Manager")
or Text.Contains([Position], "Sales")
or ([Country] = "Brazil")
)
)

missing values from sameperiodlastyear in powerpivot

Greeting. I am new to DAX.
This is what I got...
[img]https://i.ibb.co/8YsMVpV/A91-B5-FF1-569-B-4-B99-B3-C7-A3510-AE0-A798.jpg[/img]
This is what I want...
[img]https://i.ibb.co/TMqP1cW/B264458-C-BA48-4204-885-F-30-D41-DBB7754.jpg[/img]
The problem I have now is missing "Other-COT" sales from MTD LY. Everything is good (including the shop total) except "Other-COT" is not showing in my pivot table.
I guess the reason is MTD data has no Other-COT sales for shop ABC and MTD LY is bounded by MTD's season filter.
Highly appreciate if someone could help me or could give me a clue.
Below are my formulas,
Sales Net = sum(SALES[NetSales])
Sales Net MTD = CALCULATE([Sales Net],DATESMTD('Calendar'[Date]))
Sales Net MTD LY = CALCULATE([Sales Net MTD],SAMEPERIODLASTYEAR('Calendar'[Date]),FILTER(all(SALES),SALES[Date]>=STARTOFMONTH('Calendar'[Date])&&SALES[Date]<=DATEADD(STARTOFMONTH(SALES[Date]),DAY(MAX(SALES[Date]))-1,DAY)),KEEPFILTERS(Season_Master),KEEPFILTERS(Shop_Master))
And I have 2 slicers selecting Year and Month.
Million Thanks
James
Data Model

Top N by Total Sales in Year X Filter Tableau

How to place a filter in my worksheet that filters a category by top sales in a certain year while still showing all years of data for that category.
Does anyone have an idea how to do this?
One solution is to create a calculated field called Sales_In_Selected_Year that returns the sales for the year you care about and null otherwise such as:
if Year = Selected_Year then Sales end
Place Sales_In_Selected_Year on the filter shelf wth a Top filter and use the original Sales field as desired. Selected_Year can be a parameter for flexibility.

Business Objects XI Web Intelligence Aggregation Issue (11.5.8.897)

I've got a multiple tabbed report. On one tab I have the details listed and on another I have a summary table (cross reference) type of aggregation based on the same dimensions utilized in the detail report. I've created a calculated field that takes the product of two measures, I've saved this as a variable. When I try to aggregate that variable on the summary report BOWI is not calculating correctly. Example:
QTY * PRICE = LineTotal
2 * 3 = 6
4 * 3 = 12
TotalOrder = $18
Calculates correctly on the detail report.
When I put this on the aggregate report it is doing the following:
Sum QTY * Sum Price = Total, in other words it is doing
6 * 6 = $36.
My totals on the aggregate are highly inflated. Firstly in what world does that order of precedence make sense? and secondly how can I tell BOWI to sum the TotalOrders instead of breaking it back up into it's components summing those and then multiplying?
Is it a bug?
Further Information
The detail report is Sectioned by Year, Region, State -> Detail lines
The summary report is dimensioned by Year, Region, State
The (QTY * PRICE) component is saved as a variable and utilized in both places.
Am I missing the secret handshake somewhere when calculated fields/variables can't be aggregated and they need to do so in the Universe?
I havent worked with WEBI for a while, I mainly develop DESKI reports, however what you describe sounds similar to the aggregation that occurs in DESKI. If a measure is set to sum aggregation, then it will add all the measures together that relate to the dimension that is added to the report.
For example, if like my details reports, you have the columns order number, qty, price then the aggregation will sum both qty and price at the order level, which is correct. However moving to the summary table then this will cause incorrect data.
To remove the aggregation you can change it from SUM to NONE, I cant recall off the top of my head on how to do this in WEBI (if you cant find out I can check my course materials which are work).
Alternatively, it is best to ensure the dimensions on your summary report are suitable for the data presented.
If you need any further information please let me know.
Matt

Resources