Forum Discussion
Page-Level Filter by measure
I would like to filter by NOW()-1, YTD, MTD and others , but I have many parameters, So I don´t want to create
CALCULATE( SUM( TABLE[COLUMN1];TABLE[DATE]=NOW()-1)
CALCULATE( SUM( TABLE[COLUMN2];TABLE[DATE]=NOW()-1)
CALCULATE( SUM( TABLE[COLUMN3];TABLE[DATE]=NOW()-1)
.
.
.
I use direct query most of time, so I can´t use time intekigence funtion. How will I do it without create the same measure multipletimes. I want one measure and use u in page level filter for example.
3 Replies
- GilbertQ
Super User
Hi pstanek
If I understand what you are trying to do is to create a page level filter based on a date?
If so you can use the relative date slicer in the May version of Power BI Desktop?
This will allow you to filter your data in your page based on a date.
https://powerbi.microsoft.com/en-us/blog/power-bi-desktop-may-feature-summary/#relativeDateSlicer
- AnonymousNot applicable
An alternate method, should GilbertQ's not be to your liking, is to create a calculated column which does a simple IF statement to check if the row is in the date filtered range or not. Something like
inRange = IF( 'Table'[Date] < Today(), 1, 0 )
You can set your filter to only show rows where the inRange = 1
- pstanek
Post Patron
Can I use use relative slicer from certain date?
For example If I want to filter interval NOW -14 to NOW - 7 , I can´t use relative slicer. I can use relative slicer , if I want to filter NOW -7 to NOW.