Forum Discussion
Conditional Formatting
- 1 year ago
Hi,
PBI file attached.
Hope this helps.
Hi,
If you drag the previous month measure to your visual, you will see that there is no figure for 03/2025 (because you have chosen to show only the pat 5 months). Since 3010 > 0, it appears in green. That seems OK.
Hi Ashish_Mathur Technically that is correct but my usecase is to consider immediate previous month(if available in db) though the month is not part of date slicer or not displaying in the chart. Please let me know if there is any work around.
If this is not possible, then can u let me know in displaying the last N months(lowest month) only in black color rather than green color.. As 3010>0.
- alish_b1 year ago
Super User
Hi vasubabu ,
I tweaked the Previous Month qty measure as follows:Previous Month qty = CALCULATE([total_qty], PREVIOUSMONTH(DateTable[Date]), ALL(DateTable))Basically, this is altering the filter context of date that is applied to the measure.
Also, I changed the Date Slicer to have DateTable[Date] in the Field section instead of the order_date.Also, one more important thing, I found a weird behavior in the relative date slicer in the report file (I wonder if it was just on my machine and won't be replicated on yours) that it wouldn't slice properly when I added a simple table with just DateTable[Date] as Columns. It also caused the above solution to not behave as expected. (It took me for a wild goose chase and I started questioning the universe) Anyway, I deleted the slicer and added a new one and it worked as expected.
Hope it helps! - Ashish_Mathur1 year ago
Super User
Hi,
PBI file attached.
Hope this helps.