Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Vivdroid_C_4222
Frequent Visitor

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?

8 REPLIES 8
v-kpoloju-msft
Community Support
Community 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.

vkpolojumsft_0-1749209401208.png

 



Relationship:

vkpolojumsft_1-1749209401212.png

 

If slicer is Before: 6 June 2025, then the table visual will show:
outcome:

vkpolojumsft_2-1749209418454.png

 


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.

RicoZhou_0-1749430410309.png

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:

vkpolojumsft_0-1749444745561.png


outcome:

vkpolojumsft_1-1749444745563.png

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.

Nasif_Azam
Solution Specialist
Solution Specialist

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

RicoZhou
Frequent 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:

RicoZhou_0-1749198860332.png

Relationship:

RicoZhou_1-1749198893939.png

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.

RicoZhou_2-1749198963603.png

 

Best Regards,

Rico Zhou

 

Bibiano_Geraldo
Super User
Super 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.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.