Forum Discussion
Get the right measure
Hi,
I have the table below, and current measure to calculate the
YTD Race Rate = [ YTD Start Headcount by Race]/[ YTD Start Headcount ALL Race] (results are in column YTD Race Rate)
And what I need instead is to get:
YTD Race Rate =YTD Start Headcount by Race/Total YTD Start Headcount ALL Race which is the "Reuired Results"
| Race Name | YTD Start Headcount by Race | YTD Start Headcount ALL Race | YTD Race Rate | Required Results |
| A | 18 | 114 | 15.8% | 15.8% |
| B | 11 | 105 | 10.5% | 9.6% |
| C | 2 | 111 | 1.8% | 1.8% |
| D | 5 | 84 | 6.0% | 4.4% |
| E | 1 | 23 | 4.3% | 0.9% |
| F | 1 | 91 | 1.1% | 0.9% |
| G | 4 | 84 | 4.8% | 3.5% |
| H | 72 | 114 | 63.2% | 63.2% |
| Total | 114 | 114 |
To give you more context about the measures above, below are the measures I have for above table:
You're welcome! That shouldn't be an issue. Just update the measure as seen below:
Required Result Measure = VAR Numerator = [YTD Start Headcount by Race] VAR Denominator = CALCULATE ( [YTD Start Headcount by Race], ALL ( 'Table Name'[Race Name] ) ) VAR Result = DIVIDE ( Numerator, Denominator ) RETURN ResultI also update the PBIX linked in the earlier reply.
4 Replies
- SteveHailey
Solution Specialist
Hello,
Try something like this:
Required Result Measure = VAR Numerator = SUM ( 'Table Name'[YTD Start Headcount by Race] ) VAR Denominator = CALCULATE ( SUM ( 'Table Name'[YTD Start Headcount by Race] ), ALL ( 'Table Name'[Race Name] ) ) VAR Result = DIVIDE ( Numerator, Denominator ) RETURN ResultHere is a link to a PBIX.
-Steve
- AnonymousNot applicable
Hello Steve,
Thank you for your quick response! I was trying your suggested measure, but I coulnd't get the correct measure as the "YTD Start Headcount by Race" is a measure not a column. Is there any other possible way to get arround this?
- SteveHailey
Solution Specialist
You're welcome! That shouldn't be an issue. Just update the measure as seen below:
Required Result Measure = VAR Numerator = [YTD Start Headcount by Race] VAR Denominator = CALCULATE ( [YTD Start Headcount by Race], ALL ( 'Table Name'[Race Name] ) ) VAR Result = DIVIDE ( Numerator, Denominator ) RETURN ResultI also update the PBIX linked in the earlier reply.