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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
ElieK
Helper I
Helper I

Trying to use measures to calculate rates based on date

Hello,

 

The organisation I work at recently changed the rates based on the team doing the work, I've been trying to figure out how to use a measure to calculate the revenue based on the new rate.

The old rates before 01-Aug-2020

Team A150
Team B75
Team C80

 

The new Rates after 01-Aug-2020

Team A170
Team B85
Team C100

 

The measure I am using is:

Team A Revenue = CALCULATE(TeamTracker[Volume]*150,TeamTracker[Team Name]="Team A")
I tried enclossing the Calculate function in an IF Statement but could not figure out how to look at the Date column in the 'TeamTracker' table.
 
I tried creating a new Measure for the Team A Rate and using
Team A Rate = IF (Today() < Date(2020,08,01) , 150, 170)
But that just ends up taking the new value, and I cant figure out how to replace the Today() with a date value from either my TeamTracker table or Rolling Calendar table
 
Thanks
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ElieK 

I build three table to have a test.

Old Rate Table:

1.png

New Rate Table:

2.png

TeamTracker Table:

3.png

Then I build a measure to achieve your goal.

Revenue = 
VAR _VOLUME =
    SUM ( TeamTracker[Volume] )
VAR _OLDRATE =
    CALCULATE (
        SUM ( 'Old Rates'[Rate] ),
        FILTER ( 'Old Rates', 'Old Rates'[Team] = MAX ( TeamTracker[Team] ) )
    )
VAR _NEWRATE =
    CALCULATE (
        SUM ( 'New Rates'[Rate] ),
        FILTER ( 'New Rates', 'New Rates'[Team] = MAX ( TeamTracker[Team] ) )
    )
RETURN
    IF (
        MAX ( TeamTracker[Date] ) < DATE ( 2020, 08, 01 ),
        _VOLUME * _OLDRATE,
        _VOLUME * _NEWRATE
    )

Result:

4.png

You can download the pbix file from this link: Trying to use measures to calculate rates based on date

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @ElieK 

I build three table to have a test.

Old Rate Table:

1.png

New Rate Table:

2.png

TeamTracker Table:

3.png

Then I build a measure to achieve your goal.

Revenue = 
VAR _VOLUME =
    SUM ( TeamTracker[Volume] )
VAR _OLDRATE =
    CALCULATE (
        SUM ( 'Old Rates'[Rate] ),
        FILTER ( 'Old Rates', 'Old Rates'[Team] = MAX ( TeamTracker[Team] ) )
    )
VAR _NEWRATE =
    CALCULATE (
        SUM ( 'New Rates'[Rate] ),
        FILTER ( 'New Rates', 'New Rates'[Team] = MAX ( TeamTracker[Team] ) )
    )
RETURN
    IF (
        MAX ( TeamTracker[Date] ) < DATE ( 2020, 08, 01 ),
        _VOLUME * _OLDRATE,
        _VOLUME * _NEWRATE
    )

Result:

4.png

You can download the pbix file from this link: Trying to use measures to calculate rates based on date

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

Thanks @Anonymous  this helped a lot

amitchandak
Super User
Super User

@ElieK , share the data with that you want to use the rate.

 

New column = Switch( True(),

[Date] <=date(2018,01,01) && [Team] ="A" , [Volume]*150,

[Date] > date(2018,01,01) && [Team] ="A" , [Volume]*170,

/// Add other codition

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks! Is using a Calculated column the best way of doing this?

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors