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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ItuRalekoala
New Member

How to use different measures based on selected date range

Good Day

 

I have been struggling for weeks now. I need help please on using dax, I have 4 measures one for each quarter in the year. I am struggling to figure out how can One use the a certian measure based on the selected date range. eg: If user selects 01 Jan 2023-15 Jan 2023 measure 1 should apply for that period or the user selects 01 April 2023 - 15 April 2023 measure 2 should apply.

 

I would really appreciate the assistance. 

 

Regards,

 

Itu

2 REPLIES 2
ItuRalekoala
New Member

Good Day tt_and

 

 

Thank you for assisting. Kindly note that the switch formula doesn't return the calandar table, screen dump below to show what I am getting.

 

ItuRalekoala_0-1680522279092.png

 

tt_and
Helper I
Helper I

Hi. I assume you have a date table that's used for slicing on dates. If you add a column to the date table defining each period on each date row, you can use this with a switch in a base measure.

 

 

Base measure = 
switch(
    calendar[Period],
    1, [Measure1],
    2, [Measure2],
    3, [Measure3],
    4, [Measure4]
)

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors