Forum Discussion
Anonymous
7 years agoNot applicable
DAX - Filtering not working
I have a dax formula that looks at the previous year's data of difference values. I have a slicer which I can choose between Units and Sales. LastYearKPI = if([Attribute Filtered],
SWITC...
- 7 years ago
Anonymous,
It seems that you'll need to add <value>.
https://www.sqlbi.com/articles/filter-arguments-in-calculate/
Anonymous
7 years agoNot applicable
I have added a picture to help
AlB
7 years agoCommunity Champion
Anonymous
If I'm not mistaken
FILTER(PivotedData,PivotedData[Attribute Value])
will eliminate only rows for which [Attribute Value] is zero or blank( ). Do we agree?
Is that what you want to do?
- Anonymous7 years agoNot applicableThis is my code for the KPI field not LastYearKPI KPI = if([Attribute Filtered], SWITCH( [rankBy] ,"QUS",FORMAT(CALCULATE(sum(MK_PAPA_WEEKLY_PRODUCT_CARE_REPORTING[QUS]),FILTER(PivotedData,PivotedData[Attribute Value])), "#,0") ,"QUS Sales", FORMAT(CALCULATE(sum(MK_PAPA_WEEKLY_PRODUCT_CARE_REPORTING[QUS Sales]),FILTER(PivotedData,PivotedData[Attribute Value])), "£#,##0;(£#,##0)") ,blank())) This works absolutely fine and when you select a slicer of the PivotedData[Attribute Value] it filters the figure by this. I just need it so this works year on year. I can't work out how to put my code in code format in a comment