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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.