Forum Discussion
Fanis_Georg
1 year agoRegular Visitor
Dynamic comparison of values
Hello team I have a table that i have the costs of the materials for the full year broken down by month. Each month that I am running the results i add it in the same excel right under the previo...
- 1 year ago
Fanis_Georg So perhaps something like this:
Current vs. Standard = VAR __Material = MAX( 'Table'[Material] ) VAR __TableCurrent = FILTER( ALL( 'Table' ), [ResultPeriod] = "Current" ) VAR __TableSTD = FILTER( ALL( 'Table' ), [ResultPeriod] = "STD" ) VAR __Current = SUMX( __TableCurrent, [Costing] ) VAR __STD = SUMX( __TableSTD, [Costing] ) VAR __Result = __Current - __STD RETURN __Result
Greg_Deckler
Community Champion
1 year agoFanis_Georg So perhaps something like this:
Current vs. Standard =
VAR __Material = MAX( 'Table'[Material] )
VAR __TableCurrent = FILTER( ALL( 'Table' ), [ResultPeriod] = "Current" )
VAR __TableSTD = FILTER( ALL( 'Table' ), [ResultPeriod] = "STD" )
VAR __Current = SUMX( __TableCurrent, [Costing] )
VAR __STD = SUMX( __TableSTD, [Costing] )
VAR __Result = __Current - __STD
RETURN
__Result
Fanis_Georg
1 year agoRegular Visitor
Greg_Deckler your solution seems to be working but I come across another issue now. When I enter the calculate measure to my matrix i would expect a result like with 4 columns, CP-1, Current, STD, Current vs Standard. Instead i have the following, CP-1, Current vs Standard, Current, Current vs Standard, Standard, Current vs Standard. So basicaly the Current vs Standard calculated measure repeats after each and every column of the matrix.