Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello,
I would like to display the average of a column in my dashboard. In doing so, I filter my data by group.
When I select 1 group my formula works perfectly, as soon as I select more than one it does not work.
I would like to have an IF statement in my formula that checks if the slicer contains 1 or more values. If the slicer would then contain multiple values, I want to display the average of the entire data set
Current formula:
Mean = CALCULATE(GEOMEANX(Attitude, Attitude[total]), FILTER(data, data[group] = VALUES(data[group])))
What I would expect as a formula:
Mean = IF(SELECTEDVALUE(data[group] = "Multiple selections"), GEOMEANX(Attitude, Attitude[total]), CALCULATE(GEOMEANX(Attitude, Attitude[total]), FILTER(data, data[group] = SELECTEDVALUE(data[group]))))
Thanks for helping me out!
Solved! Go to Solution.
Hi @avatar456 ,
try this, it should work with single or multile selections.
Mean = CALCULATE(GEOMEANX(Attitude, Attitude[total]), FILTER(data, data[group] IN VALUES(data[group])))
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @avatar456,
Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.
If these also don't help, please share more detailed information to help us clarify your scenario to test.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
Hi @avatar456 ,
try this, it should work with single or multile selections.
Mean = CALCULATE(GEOMEANX(Attitude, Attitude[total]), FILTER(data, data[group] IN VALUES(data[group])))
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @avatar456 ,
maybe using the function HASONEVALUE.
Mean = IF(
HASONEVALUE(data[group]),
CALCULATE(GEOMEANX(Attitude, Attitude[total]), FILTER(data, data[group] = SELECTEDVALUE(data[group])),
GEOMEANX(Attitude, Attitude[total])
)
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.