Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have an existing table that I created by clicking on a table visualisation, then manually dropped a measure and dimension columns into it.
I would like to add a date filter via a custom measure to the table programatically. Normally when I add a filter to a table its by manual drag and drop then manual configuration of the filter. The date is to be extracted from a slicer drop down value from the desktop, and stored in a cutom measure, then passed to the filter on the table.
I havent done this before, so any help appreciated.
Solved! Go to Solution.
Hi @wokka You can try by creating a measure using SELECTEDVALUE to capture the slicer date (e.g., SelectedDate = SELECTEDVALUE('DateTable'[Date])). Then, create another measure to filter rows, such as FilteredTable = IF(MAX('YourTable'[DateColumn]) = [SelectedDate], 1, 0). Add this measure to the table visual’s filters pane and set it to is 1.
Hi @wokka,
Thank you for reaching out to Microsoft Fabric Community.
Make sure the fact table has a proper relationship to the calendar table on a date field.
Use this below mesure:
ShowPreviousMonthRows =
VAR SelectedMonth = SELECTEDVALUE('Calendar'[Month])
VAR TargetMonth = SelectedMonth - 1
VAR RowMonth = MONTH(MAX('Yourtable'[Date]))
RETURN
IF(RowMonth = TargetMonth, 1, 0)
Add this measure to the filters pane of the table visual and set the filter condition to 1.
This will ensure the table only shows rows from the month prior to the one selected in the slicer.
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thanks and regards,
Anjan Kumar Chippa
Hi @wokka You can try by creating a measure using SELECTEDVALUE to capture the slicer date (e.g., SelectedDate = SELECTEDVALUE('DateTable'[Date])). Then, create another measure to filter rows, such as FilteredTable = IF(MAX('YourTable'[DateColumn]) = [SelectedDate], 1, 0). Add this measure to the table visual’s filters pane and set it to is 1.
Hi, thank you for your help.
My slicer has an output of 4 ( the month of april ), which i have confirmed is correct
I get my [month behind] using this measure : [month behind] = SELECTEDVALUE('Calendar'[Month]) -1
Not sure why ?
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
69 | |
68 | |
40 | |
29 | |
26 |
User | Count |
---|---|
86 | |
49 | |
45 | |
38 | |
37 |