Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I have a date slicer, and the slicer type is set to "before" to show only the end date.
I have a table visual where I have added dates in columns.
Now if I select 6 june 2025 in slicer, I want the table to show dates from 1 june to 6 june 2025.
Similarly, if I select 4 may 2025 in slicer, I want the table to show dates from 1 may to 4 may 2025.
How do I do this?
Hi @Vivdroid_C_4222,
Thank you for reaching out to the Microsoft fabric community forum. Also thanks @Nasif_Azam, @RicoZhou, @Bibiano_Geraldo, for sharing valuable insights.
After thoroughly reviewing the details you provided, I reproduced the scenario, and it worked on my end. I used it as sample data and successfully implemented it.
Relationship:
If slicer is Before: 6 June 2025, then the table visual will show:
outcome:
I am also including .pbix file for your better understanding, please have a look into it:
If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.
Thank you for using Microsoft Community Forum.
Hi @v-kpoloju-msft ,
I don't think calculated column could return dynamic result based on slicer. There is only data in June in your sample data table. And @Vivdroid_C_4222 use before style in slicer. If you add data before, it doesn't work.
I believe that being a Microsoft Technical Support Engineer requires specialized skills, careful understanding of customer issues, and a sense of responsibility.
Best Regards,
Rico Zhou
Hi @Vivdroid_C_4222,
Apologize for the inconvenience caused. After thoroughly reviewing the details you provided, As mentioned by the @RicoZhou. I again reproduced the scenario, and it worked on my end. I used it as sample data and successfully implemented it.
Relationship:
outcome:
I am also including .pbix file for your better understanding, please have a look into it:
If this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.
Thank you for using Microsoft Community Forum.
Hi @Vivdroid_C_4222,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
Hi @Vivdroid_C_4222,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
Hey @Vivdroid_C_4222 ,
You can achieve Month-To-Date (MTD) filtering in your Power BI table visual with a "Before" date slicer by creating a calculated column or a DAX measure that dynamically determines whether a date falls within the MTD range.
1. Create a new column for Day and Month
Make sure you have a proper Date table marked as a date table. If not, create one like this:
DateTable = CALENDAR(DATE(2020, 1, 1), DATE(2030, 12, 31))
Then add the necessary columns:
Year = YEAR(DateTable[Date]) Month = MONTH(DateTable[Date]) Day = DAY(DateTable[Date])
2. Create a disconnected Date slicer
You already have a slicer set to "Before". Make sure it's using a separate date table like SlicerDateTable[Date].
3. Create a Measure to Flag MTD Dates
Now create a measure that flags rows as TRUE if the date is in the same month and year as the selected date and is less than or equal to the selected date:
IsMTDDate = VAR SelectedDate = MAX('SlicerDateTable'[Date]) RETURN IF( 'DateTable'[Date] <= SelectedDate && MONTH('DateTable'[Date]) = MONTH(SelectedDate) && YEAR('DateTable'[Date]) = YEAR(SelectedDate), 1, 0 )
4. Apply Visual Filter
Go to your table visual and drag DateTable[Date] into it. Then:
Drag the IsMTDDate measure to the filter pane of the visual.
Set the filter to IsMTDDate = 1.
Works Like
When you select June 6, 2025, the logic includes all dates from June 1 to June 6, 2025.
When you select May 4, 2025, it includes May 1 to May 4, 2025.
If you found this solution helpful, please consider accepting it and giving it a kudos (Like) it’s greatly appreciated and helps others find the solution more easily.
Best Regards,
Nasif Azam
Hi @Vivdroid_C_4222,
No need an unrelated date table. You can try to add a measure filter to filter your table visual.
My Sample Table:
Relationship:
Measure:
Measure Filter =
VAR _MONTHSTART = EOMONTH(MAX(DimDate[Date]),-1)+1
RETURN
IF(MAX('Table'[Date]) >= _MONTHSTART,1,0)
Add this measure into visual level filter and set it to show items when value = 1.
Best Regards,
Rico Zhou
Hi @Vivdroid_C_4222 ,
Your need to add disconnected dateTable to reach your goal, if you could share no sensitive file to help you, it will be very helpful to give you, the more accurated answer.
User | Count |
---|---|
84 | |
80 | |
70 | |
47 | |
43 |
User | Count |
---|---|
108 | |
54 | |
50 | |
40 | |
40 |