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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

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
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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