Forum Discussion
Anonymous
4 years agoNot applicable
Measure Total is wrong
masure total is wrong- 1) we have two masure in table visualization with total like masure A & B 2) requirement is if (A-B<0,0,A-B), so i need to takeout the all +ve value from A-B(and assign ...
- 4 years ago
Ok, I just tried these out:
With both dimensions:
Sum +ves = SUMX ( 'FactTable', CALCULATE ( IF ( [Sum Amount] - [Sum Target] < 0, 0, [Sum Amount] - [Sum Target] ) ) )With 1 dimension
Sum +ves Cat = VAR _cat = ADDCOLUMNS ( VALUES ( FactTable[Category] ), "_+ves", IF ( [Sum Amount] - [Sum Target] < 0, 0, [Sum Amount] - [Sum Target] ) ) RETURN SUMX ( _cat, [_+ves] )I've attached the sample PBIX file
- Anonymous4 years ago
it works for me after doing some R&D.
measure C = meaasure A- Measure B.
+ve total = Calculate([C],FILTER(SUMMARIZE(FACTTABLE,PARENTDIMTABLE[COLUMN],FACTTABLE[COLUMN]),[C]>0))
PaulDBrown
4 years agoCommunity Champion
Try:
With Totals =
VAR Z =
ADDCOLUMNS (
VALUES ( table[column] ),
"C",
CALCULATE (
IF ( [Measure A ] - [Measure B] < 0, 0, [Measure A ] - [Measure B] )
)
)
RETURN
SUMX ( Z, [C] )
- Anonymous4 years agoNot applicable
Appriciate your response!!
its giving same result as measure 2 mantioned above . still not getting the correct total should we use
HASONEFILTER by increasing no of argument with nested if.. please share thoughts
- PaulDBrown4 years agoCommunity Champion
Ok, I just tried these out:
With both dimensions:
Sum +ves = SUMX ( 'FactTable', CALCULATE ( IF ( [Sum Amount] - [Sum Target] < 0, 0, [Sum Amount] - [Sum Target] ) ) )With 1 dimension
Sum +ves Cat = VAR _cat = ADDCOLUMNS ( VALUES ( FactTable[Category] ), "_+ves", IF ( [Sum Amount] - [Sum Target] < 0, 0, [Sum Amount] - [Sum Target] ) ) RETURN SUMX ( _cat, [_+ves] )I've attached the sample PBIX file