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.
Hi Folks,
I need your help to calculate Usage formula for each "Serial Number". The formula for Total Usage I have currently built is just subtracting the Max Hours Meter Reading with Minimum Hours Meter Reading. It works fine if the Model has only one Serial Number, however if the Model has multiple serial number (Please see the serial number column in Screenshot), I need to calculate the Max-Min for each Serial Number and then calculate the average to get "Total Usage". Currently the Total Usage is 693 (884-191) but it should be 119(884-765) and 16(207-191) and the average of 119 and 16 should be 67.5 (Average Usage). Please see the attached screenshot for the data I have. Please see the blue highlighted columns.
Solved! Go to Solution.
You need to summarize by serial number and then work out the average of the individual values, something like
Total Usage = AVERAGEX(
ADDCOLUMNS( SUMMARIZE( TableName[Serial Number] ),
"@usage", CALCULATE( MAX( TableName[Meter Hours]) - MIN( TableName[Meter Hours] ) )
),
[@usage]
)
It's working, thank you!
It's giving me syntax error.
You need to summarize by serial number and then work out the average of the individual values, something like
Total Usage = AVERAGEX(
ADDCOLUMNS( SUMMARIZE( TableName[Serial Number] ),
"@usage", CALCULATE( MAX( TableName[Meter Hours]) - MIN( TableName[Meter Hours] ) )
),
[@usage]
)
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 |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
150 | |
115 | |
104 | |
89 | |
65 |