Forum Discussion

Juanes_Agudelo's avatar
Juanes_Agudelo
Frequent Visitor
1 year ago
Solved

DAX error calculating Pareto

Hi everyone, I'm trying to calculate which customers are responsible for 80% of the YTD revenue in my model, based on the month selected by the user via the 'Calendar'[Month Year] slicer (e.g., Mar ...
  • johnt75's avatar
    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.