Forum Discussion
DAX Measure Calculate only on certain rows
Hi
In the measure below i create the same value for many dimensions from the table "vReporting".
However I further need this calculation only to be done for one certain value from "vReporting".
So something like IF(vReporting[AccountNo=1,Test2,0)
Can I in some way include this condition in my measure?
The thing is that measure Test2 includes a higher value than vReporting[AccountNo=1
Test2:=
CALCULATE (
[Actual period];
FILTER (
ALL ( 'Dim_Time' );
'Dim_Time'[Year] = MAX ( 'Dim_Time'[Year] )
&& 'DIM_Time'[DateValue] <= MAX ( 'DIM_Time'[DateValue])
) ;FILTER (
ALL ( 'vReporting' );
'vReporting'[Type] = "Resultatopgørelse"
&& 'vReporting'[Niv] = 0
))
4 Replies
- v-juanli-msftCommunity Support
What do you mean by saying "measure Test2 includes a higher value than vReporting[AccountNo=1"?
Best regards
Maggie
- DennisPedersenFrequent Visitor
Hi Maggie
Thanks for helping.
I came a litte longer so that it now looks like this:
But now my problem is that when I try to put 'FinanceGLEntry-'[G_L Account No_
in a row in a excel pivottable excel is saying that more values were returned where only 1 was expected?
Copy of Test2:= if(values('FinanceGLEntry-'[G_L Account No_])="707150";
CALCULATE (
[Actual period];
FILTER (
ALL ( 'Dim_Time' );
'Dim_Time'[Year] = MAX ( 'Dim_Time'[Year] )
&& 'DIM_Time'[DateValue] <= MAX ( 'DIM_Time'[DateValue])
) ;FILTER (
ALL ( 'vReporting' );
'vReporting'[Type] = "Resultatopgørelse"
&& 'vReporting'[Niv] = 0
));0)
- v-juanli-msftCommunity Support
Does [Actual period] calculate using "distinct" or any else ?
Maybe the [Actual period] using a table function which will return a table not a column.
Best Regards
Maggie
- DennisPedersenFrequent Visitor
Hi again
Actual period:=sum('FinanceGLEntry-'[Amount2])
did that help?