Forum Discussion
Anonymous
2 years agoNot applicable
Measure doesn't working with selectedvalue
Hi, i need help! I have the follow measure: REAL = CALCULATE(
sum(BA_DIARIO[VLR_LANCAMENTO])/1000000,
LASTDATE(BA_DIARIO[DT_EXEC])
) This one works fine and do what i need ...
- 2 years ago
Anonymous Ok, it's more clear. So try with create a new calculated table:
DC_TABLE = DISTINCT(BA_DIARIO[DC])you have to relate this table with BA_DIARIO and use this new table as column in the matrix.Then create another new table:DT_TABLE = DISTINCT(BA_DIARIO[DT_EXEC])but DON'T relate this new one with BA_DIARIO.Then calculate measure like:Sum Switch =VAR BN6 = CALCULATE(SUM(BA_DIARIO[VLR_LANCAMENTO]) / 1000000, DC_TABLE[BA_DIARIO_DC] = "BN 6 + 6")VAR MAXDTEXEC = MAX(DT_TABLE[DT_EXEC])VAR DCMAXEXEC = CALCULATE(SUM(BA_DIARIO[VLR_LANCAMENTO]) /1000000, BA_DIARIO[DT_EXEC] = MAXDTEXEC, ALL(DC_TABLE))VAR CALC =IF(SELECTEDVALUE (DC_TABLE[BA_DIARIO_DC] ) = "△ REAL X BN", BN6 - DCMAXEXEC, SUM(BA_DIARIO[VLR_LANCAMENTO]) / 1000000)RETURN CALCand you achieve the output:BBF
BeaBF
Super User
2 years agoAnonymous the reason of always blank is that there is no VLR_LANCAMENTO value for DC = △ REAL X BN. Let's see the table:
because of blank values in VLR_LANCAMENTO, also REAL is Blank.
BBF
Anonymous
2 years agoNot applicable
BeaBF , swap in measure SELECTEDVALUE(BA_DIARIO[DC]) = "△ REAL X BN", [REAL] by
SELECTEDVALUE(BA_DIARIO[DC]) = "△ REAL X BN", 0. U will see what i'm talking. My logical is working, but idk how to handle with this dax issue to perform [REAL] - [BN].