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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Satz27
Frequent Visitor

measures with filter slicer month [Need Help]

I have an unresolved case, I want to make measures if the selected month slicer is only 1 month using the sum formula, but if the selected one is more than 1 month then use the average formula. what formula does this use?

1 ACCEPTED SOLUTION
moizsherwani
Continued Contributor
Continued Contributor

Hi there, 

 

Does the following work for you?

 

SampleMeasure = 
VAR SelectedMonth =
    SELECTEDVALUE ( SampleData[Date] )
RETURN
    IF (
        NOT ( ISBLANK ( SelectedMonth ) ),
        SUM ( SampleData[Val] ),
        AVERAGE ( SampleData[Val] )
    )

With one value selected

 

moizsherwani_0-1631971146298.png

With more than one value selected

 

moizsherwani_1-1631971183188.png

 

Thanks,

Moiz
Was I able to answer your question? Mark my post as a solution to help others. Kudos if you liked the solution.

View solution in original post

2 REPLIES 2
moizsherwani
Continued Contributor
Continued Contributor

Hi there, 

 

Does the following work for you?

 

SampleMeasure = 
VAR SelectedMonth =
    SELECTEDVALUE ( SampleData[Date] )
RETURN
    IF (
        NOT ( ISBLANK ( SelectedMonth ) ),
        SUM ( SampleData[Val] ),
        AVERAGE ( SampleData[Val] )
    )

With one value selected

 

moizsherwani_0-1631971146298.png

With more than one value selected

 

moizsherwani_1-1631971183188.png

 

Thanks,

Moiz
Was I able to answer your question? Mark my post as a solution to help others. Kudos if you liked the solution.

Thank you very helpful

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors