Forum Discussion
Calculation should not change based on filter selection
Hello community I am learning DAX new recently,
I have a question about ignoring a calculation based on the filter criteria
As you can see on the picture the market shares are calculated correctly.
When I select Brand a it shows me 100% but I want it to show me 35% like in the first picture.
My Measure:
I would be very happy about an answer
ys034 , Try
CALCULATE(SUMX(VALUES('DataTable'),'DataTable'[Sales]),filter(ALLSELECTED('DataTable'))
or
Grand Total Sales = CALCULATE(SUMX(VALUES('DataTable'),'DataTable'[Sales]),filter(ALL('DataTable'), 'DataTable'[Date].[Year] = max('DataTable'[Date].[Year])),FILTER(ALLSELECTED('DataTable'),'DataTable'[Country] = MAX('DataTable'[Country])))
2 Replies
- amitchandak
Super User
ys034 , Try
CALCULATE(SUMX(VALUES('DataTable'),'DataTable'[Sales]),filter(ALLSELECTED('DataTable'))
or
Grand Total Sales = CALCULATE(SUMX(VALUES('DataTable'),'DataTable'[Sales]),filter(ALL('DataTable'), 'DataTable'[Date].[Year] = max('DataTable'[Date].[Year])),FILTER(ALLSELECTED('DataTable'),'DataTable'[Country] = MAX('DataTable'[Country])))
- ys034
Helper I
amitchandak thank you very much now it works!