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 Experts,
Im currently struggeling on getting the correct DAX computation to get the cost per minute.
Below i created a Dax calculation to get the "per minute' cost
Per minute = DIVIDE([Total], [Minutes]) which is correct
Date | Minutes | Per minute | Total |
2022-1 | 205 | 9.4 | 1927 |
2022-2 | 145 | 8.51 | 1235 |
2022-3 | 943 | 6.84 | 6453 |
But here whenever i add the "users" it spreadsout the "minutes" to each user which result to change the cost per minute
Date | User | Minutes | Per minute | Total |
2022-1 | A | 105 | 18.35 | 1927 |
2022-1 | B | 100 | 19.27 | 1927 |
2022-2 | A | 45 | 27.44 | 1235 |
2022-2 | B | 100 | 12.35 | 1235 |
Is there a better way to get "Per Minute" value based on "total" cost divided by the overall "Minutes" per month while ignoring the users then multiple the "per minute" to the "munites" used per "user?
Something like this
Base price per month
Date | Minutes | Per minute | Total |
2022-1 | 205 | 9.4 | 1927 |
2022-2 | 145 | 8.51 | 1235 |
2022-3 | 943 | 6.84 | 6453 |
Date | User | Minutes | Per minute | total per user | Total |
2022-1 | A | 105 | 9.4 | 987 | 1927 |
2022-1 | B | 100 | 9.4 | 940 | 1927 |
2022-2 | A | 45 | 8.51 | 382.95 | 1235 |
2022-2 | B | 100 | 8.51 | 851 | 1235 |
Solved! Go to Solution.
Hi @JG00012 ,
Please try below steps:
1. below is my test table
Table:
2. create measure with below dax formula
Per Minutes =
VAR cur_date =
SELECTEDVALUE ( 'Table'[Date] )
VAR _minutes =
CALCULATE (
SUM ( 'Table'[Minutes] ),
FILTER ( ALL ( 'Table' ), 'Table'[Date] = cur_date )
)
VAR cur_total =
SELECTEDVALUE ( 'Table'[Total] )
RETURN
DIVIDE ( cur_total, _minutes )
Total Per User =
VAR per_minute = [Per Minutes]
VAR _minute =
SELECTEDVALUE ( 'Table'[Minutes] )
RETURN
per_minute * _minute
3. add table visual with fields and measure
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @JG00012 ,
Please try below steps:
1. below is my test table
Table:
2. create measure with below dax formula
Per Minutes =
VAR cur_date =
SELECTEDVALUE ( 'Table'[Date] )
VAR _minutes =
CALCULATE (
SUM ( 'Table'[Minutes] ),
FILTER ( ALL ( 'Table' ), 'Table'[Date] = cur_date )
)
VAR cur_total =
SELECTEDVALUE ( 'Table'[Total] )
RETURN
DIVIDE ( cur_total, _minutes )
Total Per User =
VAR per_minute = [Per Minutes]
VAR _minute =
SELECTEDVALUE ( 'Table'[Minutes] )
RETURN
per_minute * _minute
3. add table visual with fields and measure
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you!
This help me out off my problem!
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 |
---|---|
104 | |
101 | |
79 | |
72 | |
64 |
User | Count |
---|---|
142 | |
108 | |
101 | |
81 | |
74 |