Forum Discussion
andrehawari
Helper II
7 years agoMeasures That have Different Behaviour Between Category
Hi I have the following table below. Basically I want to create the measure that have following behaviour, IF, Category=A, then average(Sales) else IF Category=B, then sum(Sales). I have...
- 7 years ago
Hi andrehawari,
Based on my test, you could refer to below formula:
Measure = IF(MAX('Table1'[Category])="A",CALCULATE(AVERAGE(Table1[Sales]),ALL(Table1)),CALCULATE(SUM(Table1[Sales]),ALL(Table1)))Result:
You could also download the pbix file to have a view.
Regards,
Daniel He
v-danhe-msft
Microsoft Employee
7 years agoHi andrehawari,
Could you please tell me if your problem has been solved? If it is, could you please mark the helpful replies as Answered?
Regards,
Daniel He