Hi ,
Average Products Per Q = AVERAGEX(
VALUES( Calendar[Quarter & Year] ),
[Total Products] )
and
Average Product All Q =
CALCULATE( [Average Products Per Q], ALL( Calendar ))
what should happen when i choose specific Quarter , the all formula amount should not becasue of All but that didn’t happen and it change
what could be the reason i checked my model i didn’t find a problem in relationship
Thanks,
Abeer
Avg. ALL Quantity per Q = CALCULATE( [Avg. Quantity per Q], ALL(Dim_Dates) )
Instead, if I use ALL(Dim_Dates[Quarter & Year]) instead of ALL(Dim_Dates), it doesn’t work well because we haven’t really removed this field from the filter context since I have it sorted by the numeric field Dim_Dates[Quarter & Year Sort]. To remove it completely we need to remove both fields:
Avg ALL Quantity per Q = CALCULATE( [Avg. Quantity per Q], ALL(Dim_Dates[Quarter & Year]), ALL(Dim_Dates[Quarter & Year Sort]) )
If you can share the example of the pbix file you are testing on it would be a great help.
This is my example.
Average Product All Q = CALCULATE( [Average Products Per Q], ALL(Calender) )
which you are using in the table by Customers[Customers Names]
of the Abnormal Purchasing Batterns tab, as this table has a filter context of Customers[Customers Names], we have to ignore it in the calculation of the measure.
Average Product All Q = CALCULATE( [Average Products Per Q], ALL(Calender), ALL( Customers[Customer Names]) )
If you see the other file i sent which is detect abnormal patterns,
you will find that Sam Macy made it without add All(customers name) to the formula and it is working , can you check it Pls. and see, that what confuse me since yesterday.
Thanks
Abeer
Hi @Abeer,
In the Detect Abnormal Patterns In Behavior Using DAX In Power BI file in the measure:
Avg. Products Bought in Quarter =
AVERAGEX(
VALUES( Dates[Quarter & Year] ),
[Unique Products Bought] )
You are calculating the average of the different products sold for each customer taking into account the filters of the Dates table.
In the second:
Avg. Products Bought All Quarters = CALCULATE( [Avg. Products Bought in Quarter], ALL( Dates ) )
It performs the same calculation for each client but without taking into account the filters of the Dates table.
In the third:
Avg. Products Bought All Quarters And ALL Customers = CALCULATE( [Avg. Products Bought in Quarter], ALL( Dates ) , ALL(Customers[Customer Name] ) )
Calculates the average of the different products sold for all dates and customers.
In the Calculations tab I did the same measurements for Sum of Quantity to see it more clearly.
Hi @Abeer, due to inactivity, a response on this post has been tagged as “Solution”. If you have any concern related to this topic, you can create a new thread.