Forum Discussion
Fusilier
2 years agoHelper III
Help with Measure
Help with measure 3 hours ago Hi, Probably best to illustrate what I am trying to achieve in PBI with the tables below in. My data table consists of individual responses to a survey. On...
- 2 years ago
To start, I unpivoted the data in Power Query to look like this:
Measures:
Count = SUM ( 'All Responses (2)'[Answer Count] )Pct = DIVIDE ( [Count], CALCULATE ( [Count], ALLSELECTED ( 'All Responses (2)'[Category] ) ) )Pct to Total Variance = VAR vPct = [Pct] VAR vNumerator = CALCULATE ( [Count], ALLSELECTED ( 'All Responses (2)' ), VALUES ( 'All Responses (2)'[Category] ) ) VAR vDenominator = CALCULATE ( [Count], ALLSELECTED () ) VAR vCategoryTotal = DIVIDE ( vNumerator, vDenominator ) VAR vResult = vPct - vCategoryTotal RETURN vResult
DataInsights
2 years agoSuper User
To start, I unpivoted the data in Power Query to look like this:
Measures:
Count = SUM ( 'All Responses (2)'[Answer Count] )Pct =
DIVIDE (
[Count],
CALCULATE ( [Count], ALLSELECTED ( 'All Responses (2)'[Category] ) )
)Pct to Total Variance =
VAR vPct = [Pct]
VAR vNumerator =
CALCULATE (
[Count],
ALLSELECTED ( 'All Responses (2)' ),
VALUES ( 'All Responses (2)'[Category] )
)
VAR vDenominator =
CALCULATE ( [Count], ALLSELECTED () )
VAR vCategoryTotal =
DIVIDE ( vNumerator, vDenominator )
VAR vResult = vPct - vCategoryTotal
RETURN
vResult