Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Using multiple selections from slicer in measure

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! 

 

1 ACCEPTED SOLUTION
mangaus1111
Solution Sage
Solution Sage

Hi @Anonymous ,

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.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous,

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

mangaus1111
Solution Sage
Solution Sage

Hi @Anonymous ,

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.

mangaus1111
Solution Sage
Solution Sage

Hi @Anonymous ,

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.

Anonymous
Not applicable

@mangaus1111 thank you for your answer. 

 

I get the following error, any idea? 

avatar456_0-1667228282761.png

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.