Forum Discussion
DAX error calculating Pareto
- 1 year ago
I think that the problem arises because you are using the customer data from the fact table, not from the customer dimension table. When you are using SUMMARIZE( ALLSELECTED( 'Fact_Revenue'[Customer] ) ) that will only retrieve customers who have a row in the fact table for the selected month. You could instead use SUMMARIZE( ALL( 'Fact_Revenue'[Customer] ) ) or use a column from the customer dimension table instead.
You could also simplify your Selected Revenue YTD measure to
Selected Revenue YTD = CALCULATE ( [Revenue], DATESYTD ( 'Calendar'[Date] ) )That won't fix the problem, but it is easier to read and might give a small performance boost.
I think that the problem arises because you are using the customer data from the fact table, not from the customer dimension table. When you are using SUMMARIZE( ALLSELECTED( 'Fact_Revenue'[Customer] ) ) that will only retrieve customers who have a row in the fact table for the selected month. You could instead use SUMMARIZE( ALL( 'Fact_Revenue'[Customer] ) ) or use a column from the customer dimension table instead.
You could also simplify your Selected Revenue YTD measure to
Selected Revenue YTD =
CALCULATE ( [Revenue], DATESYTD ( 'Calendar'[Date] ) )
That won't fix the problem, but it is easier to read and might give a small performance boost.
You were right on "that will only retrieve customers who have a row in the fact table for the selected month".
For people with similar issue, the solution to work with a Dimention table AND remenber to Add to the visualisation the customer field from the dimentional table. Otherwise, it will not work.