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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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?
Solved! Go to Solution.
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
With more than one value selected
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
With more than one value selected
Thank you very helpful