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,
Look into calculation groups. Here is a potential resource for you; they talk about using an external tool but calculation groups were recently introduced in Power BI as a native functionality I believe.
----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)
P.S. Need a more in-depth consultation for your Power BI data modeling or DAX issues? Feel free to hire me on Upwork or DM me directly on here! I would love to clear up your Power BI headaches.
Hi Wilson_ ,
thank you for your suggestion. Anonymous 's solution was easier to implement, so I opted for this one. Nevertheless, thanks again for your suggestion.
- Wilson_2 years ago
Memorable Member
hamoso,
No worries, calculation groups are more robust if you're looking to scale the ability to do what you're trying to do. Understandable to go a different direction if you're just trying to do it one time. Glad you got something that works for you. 😄