Forum Discussion
JFR2022
2 years agoFrequent Visitor
Matrix - filter every red coloured rows
Hi, For a stock overview report i've created a conditonal measure which colours the value for each article in each month red if the stock goes below zero or below the minimal stock quantity. To m...
PurpleGate
Resolver III
2 years agoCould you try adding some variables to the measure so that it looks at each column individually?
var _thismonth = CALCULATE(SELECTEDVALUE(Date[Month]),FILTER(Date,Date[Date] = TODAY()))
var _lastmonth = CALCULATE(SELECTEDVALUE(Date[Month]),DATESMTD(DATEADD(Date[Date],-1,MONTH)))
var _filter =IF(OR(AND([kleurvariabelen 1] = "#EFB5B9",lastmonth ),AND([kleurvariabelen 1] = "#EFB5B9",thismonth)), 1,0)
Return _filter
JFR2022
2 years agoFrequent Visitor
Hi,
Thank you for your reply!
Unfortunately this is not working for me at the moment. This is how my measure looks right now, to make it more clear i've added the "kleurvariabelen" measure as a variable to the new measure. It basically says if the cumulative stock measure > the minimum stock measure or >0 it should become red.
I've adjusted your _lastmonth to _nextmonth because I have to look in te future instead of the past.
Kleurfilter =
var _kleurvariabelen = if(OR([cumulatieve voorraad] < [som minimale voorraad], [cumulatieve voorraad] < 0),"#EFB5B9","#FFFFFF")
var _thismonth = calculate(SELECTEDVALUE('Date toekomst'[YearMonthnumber]),filter('Date toekomst','Date toekomst'[Date] = today()))
var _nextmonth = calculate(SELECTEDVALUE('Date toekomst'[YearMonthnumber]),DATESMTD(DATEADD('Date toekomst'[Date],1,MONTH)))
var _filter = IF(OR(AND(_kleurvariabelen = "#EFB5B9",_thismonth),and(_kleurvariabelen = "#EFB5B9",_nextmonth)),1,0)
Return _filter
The result of this measure is the same as I've had with my original measure. The YearMonthNumber is the column I'm using in my slicer list: