Forum Discussion
Dax function ignores slicer
- 3 years agoHello polman4,Try the below Measure:diff =var _max = CALCULATE(MAX('Table'[Column]), FILTER(ALLEXCEPT('Table', 'Table'[Type]), [author] = MAX([author])&& [Column] < MAX([Column])))var _pir= CALCULATE(SUM([value]), FILTER(ALLEXCEPT('Table', 'Table'[Type]), [author] = MAX([author])&& [Column] = _max))var _result= DIVIDE(SUM([value]), _pir) - 1return IF(_result = -1, BLANK(), _result)
Hello ReneMoawad
Thank you for the reply. Didn't really understand what change to do. What part of code to replace?
Thank you
Instead of using ALL('nw_content') you can use ALL('nw_content'[Author_Clm], 'nw_content'[Week_Start_Date])
% Pageviews =
VAR _max =
CALCULATE (
MAX ( 'nw_content'[Week_Start_Date] ),
FILTER (
ALL('nw_content'[Author_Clm], 'nw_content'[Week_Start_Date]), [Author_Clm] = MAX ( [Author_Clm] ) && [Week_Start_Date] < MAX ( [Week_Start_Date] )
)
)
VAR _pir =
CALCULATE (
SUM ( [Pageviews] ),
FILTER (
ALL('nw_content'[Author_Clm], 'nw_content'[Week_Start_Date]), [Author_Clm] = MAX ( [Author_Clm] ) && [Week_Start_Date] = _max )
)
VAR _result =
DIVIDE ( SUM ( [Pageviews] ), _pir ) - 1
RETURN
IF ( _result = -1, "no data", _result )
- polman43 years agoHelper I
This gives me back no data for the variable _pir 😕
- ReneMoawad3 years agoResolver III
Can you please share some of sample data from the tables that you have?
- polman43 years agoHelper I
Hello ReneMoawad
Sorry for the late reply but was OOF.
The solution i'm using was originally being created by v-yalanwu-msft.
Didn't found out how to include attachments so i'm sending a sample file with wetransfer
So if you click to any checkbox, you can see that the data doesn't really make sense and i'm suspecting the function "ALL" is causing this.
Kind regards,
Greg