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
Bryanna
Helper II
Helper II

How to calculate a Rate for certain time period

How can i calculate in PBI if my date is between 10/1/2021 and 9/30/2022 that it multiplies by 'x rate'.  If the date is between 10/1/2022 and 9/30/2023 that it multiples by 'y date'.

 

Basically my rate changes every year and want to be able to see the old rate during the correct time period and the new year during the new time period.

1 ACCEPTED SOLUTION
AnthonyJoseph
Resolver III
Resolver III

Hi @Bryanna 

 

I would use switch function. Below how the sample measure will look like

switch = 
SWITCH(TRUE(),
min('Table'[Date])<=date(2022,09,30), "x multiples measure",
Min('Table'[Date])<=date(2023,09,30), "y multiples measure"
)

 

AnthonyJoseph_0-1662576834880.png

you can either create measure to multiple by x or y OR directly use the formula inside switch.

 

Hope this helps!

 

Thanks,

AnthonyJospeh

View solution in original post

3 REPLIES 3
Bryanna
Helper II
Helper II

Does my date column need to be in a certain format? Its not recognizing the date and is categorizing everything as the same.

 

Bryanna_0-1662583524585.png

 

Hi @Bryanna , I think your column is in "Date/time" datatype format. Please can you change to "Date" datatype and try the measure.

 

AnthonyJoseph_0-1662699810281.png

 

Thanks,

AnthonyJoseph

AnthonyJoseph
Resolver III
Resolver III

Hi @Bryanna 

 

I would use switch function. Below how the sample measure will look like

switch = 
SWITCH(TRUE(),
min('Table'[Date])<=date(2022,09,30), "x multiples measure",
Min('Table'[Date])<=date(2023,09,30), "y multiples measure"
)

 

AnthonyJoseph_0-1662576834880.png

you can either create measure to multiple by x or y OR directly use the formula inside switch.

 

Hope this helps!

 

Thanks,

AnthonyJospeh

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