Forum Discussion
apollo89
6 years agoHelper II
Use DAX Measure as Categories
Consider the following table: Name Field Value A ABC -10 A DEF 15 B ABC -20 B DEF 25 C ABC 15 D ABC 20 D DEF 25 E ABC -1 E DEF 2 I am tryi...
- 6 years ago
apollo89 , Check new category column
- 6 years ago
Hi,
These calculated column formulas work
Total for Name = =CALCULATE(SUM(Data[Value]),FILTER(data,Data[Name]=EARLIER(Data[Name])))Total for all names = SUM(Data[Value])Threshold = 0.05*[Total for all names]Category = if([Total for name]>[Threshold],Data[Name],"Others")Hope this helps.
Ashish_Mathur
6 years agoSuper User
Hi,
Write these measures
Total value = SUM(Data[Value])Threshold = 0.05*CALCULATE([Total value],ALL(Data[Name]))Measure = if(HASONEVALUE(Data[Name]),if([Total value]>=[Threshold],VALUES(Data[Name]),"Others"))
Hope this helps.
- apollo896 years agoHelper II
Thanks Ashish.
However I need to be placing 'Measure' as a column or a slicer in my report visuals which is not possible since it's a Measure. Any other suggestions?
- Ashish_Mathur6 years agoSuper User
Hi,
These calculated column formulas work
Total for Name = =CALCULATE(SUM(Data[Value]),FILTER(data,Data[Name]=EARLIER(Data[Name])))Total for all names = SUM(Data[Value])Threshold = 0.05*[Total for all names]Category = if([Total for name]>[Threshold],Data[Name],"Others")Hope this helps.