Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
95 | |
77 | |
68 | |
54 |
User | Count |
---|---|
144 | |
105 | |
102 | |
89 | |
63 |