Forum Discussion
Help! How do I show MTD dates in Table Visual.
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 the update. Could you please share the sample data related to your thread? This would help me reproduce the scenario and work towards a solution. Please provide the sample data in table format, along with the expected outcome based on your thread.
Thank you.
14 Replies
- v-kpoloju-msftCommunity Support
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.- RicoZhouFrequent Visitor
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
- v-kpoloju-msftCommunity Support
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.
- Bibiano_GeraldoSuper User
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.
- RicoZhouFrequent Visitor
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
- Nasif_AzamSuper User
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