Forum Discussion
Different Calculation at Category Level?
- 2 years ago
Hi plantew1
Try to use isinscope instead of isfiltered.https://www.youtube.com/watch?v=DtOfcsS_pQw
if it doesn't help
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
- Anonymous2 years ago
Hi plantew1
You can consider to create two measures
Measure1 = VAR _RecentDate = MAX ( 'CIHI___LTC_Data_Quality'[Begin Date] ) VAR _SecondRecentDate = CALCULATE ( MAX ( 'CIHI___LTC_Data_Quality'[Begin Date] ), 'CIHI___LTC_Data_Quality'[Begin Date] < _RecentDate ) VAR _Calc1 = CALCULATE ( SUM ( 'CIHI___LTC_Data_Quality'[Indicator Value] ), 'CIHI___LTC_Data_Quality'[Begin Date] = _RecentDate ) VAR _Calc2 = CALCULATE ( SUM ( 'CIHI___LTC_Data_Quality'[Indicator Value] ), 'CIHI___LTC_Data_Quality'[Begin Date] = _SecondRecentDate ) VAR _PercentofChange = ABS ( DIVIDE ( ( _Calc1 - _Calc2 ), _Calc2 ) ) RETURN IF ( _PercentofChange <= .05, BLANK (), 1 )Measure2 = IF ( ISINSCOPE ( 'LTC Indicators'[Indicator Category] ), SUMX ( VALUES ( 'LTC Indicators'[Indicator Category] ), [Measure1] ), IF ( ISINSCOPE ( 'LTC Indicators'[Indicator] ), SUMX ( VALUES ( 'LTC Indicators'[Indicator] ), [Measure1] ) ) )Then put the Measure2 to the matrix.
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi plantew1
You can consider to create two measures
Measure1 =
VAR _RecentDate =
MAX ( 'CIHI___LTC_Data_Quality'[Begin Date] )
VAR _SecondRecentDate =
CALCULATE (
MAX ( 'CIHI___LTC_Data_Quality'[Begin Date] ),
'CIHI___LTC_Data_Quality'[Begin Date] < _RecentDate
)
VAR _Calc1 =
CALCULATE (
SUM ( 'CIHI___LTC_Data_Quality'[Indicator Value] ),
'CIHI___LTC_Data_Quality'[Begin Date] = _RecentDate
)
VAR _Calc2 =
CALCULATE (
SUM ( 'CIHI___LTC_Data_Quality'[Indicator Value] ),
'CIHI___LTC_Data_Quality'[Begin Date] = _SecondRecentDate
)
VAR _PercentofChange =
ABS ( DIVIDE ( ( _Calc1 - _Calc2 ), _Calc2 ) )
RETURN
IF ( _PercentofChange <= .05, BLANK (), 1 )
Measure2 =
IF (
ISINSCOPE ( 'LTC Indicators'[Indicator Category] ),
SUMX ( VALUES ( 'LTC Indicators'[Indicator Category] ), [Measure1] ),
IF (
ISINSCOPE ( 'LTC Indicators'[Indicator] ),
SUMX ( VALUES ( 'LTC Indicators'[Indicator] ), [Measure1] )
)
)
Then put the Measure2 to the matrix.
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you. Very helpful.