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.
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 A | 150 |
Team B | 75 |
Team C | 80 |
The new Rates after 01-Aug-2020
Team A | 170 |
Team B | 85 |
Team C | 100 |
The measure I am using is:
Team A Revenue = CALCULATE(TeamTracker[Volume]*150,TeamTracker[Team Name]="Team A")
Team A Rate = IF (Today() < Date(2020,08,01) , 150, 170)
Solved! Go to Solution.
Hi @ElieK
I build three table to have a test.
Old Rate Table:
New Rate Table:
TeamTracker Table:
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:
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.
Hi @ElieK
I build three table to have a test.
Old Rate Table:
New Rate Table:
TeamTracker Table:
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:
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.
@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
Thanks! Is using a Calculated column the best way of doing this?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |