Forum Discussion
Create aggregate (AVG, MIN, MAX, SUM, ...) Slicer
- Anonymous2 years ago
Hi hamoso ,
The Table data is shown below:
Please follow these steps:
1.Create a table and enter the following data manually.
2.Use the following DAX expression to create a measure
Measure = VAR _a = SELECTEDVALUE('Table 2'[Type]) VAR _b = IF(_a = "Sum",SUM('Table'[Value]), IF(_a = "Average",AVERAGE('Table'[Value]), IF(_a = "Minimum",MIN('Table'[Value]), IF(_a = "Maximum",MAX('Table'[Value]), IF(_a = "Count",COUNT('Table'[Value])))))) RETURN _b3.Final output
Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi hamoso ,
The Table data is shown below:
Please follow these steps:
1.Create a table and enter the following data manually.
2.Use the following DAX expression to create a measure
Measure =
VAR _a = SELECTEDVALUE('Table 2'[Type])
VAR _b = IF(_a = "Sum",SUM('Table'[Value]),
IF(_a = "Average",AVERAGE('Table'[Value]),
IF(_a = "Minimum",MIN('Table'[Value]),
IF(_a = "Maximum",MAX('Table'[Value]),
IF(_a = "Count",COUNT('Table'[Value]))))))
RETURN _b
3.Final output
Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
you are the best! Thank you for your help. This was excactly what I was looking for. 🙂