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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
YunJ
Post Prodigy
Post Prodigy

How to show specific date based on slicer?

Hi,

 

In my original raw data, it starts from 1/1/2019 to 9/15/2021.

I'm wondering whether I can achieve this performance:

 

If the slicer YearMonth = 2021/07, the bar chart will only show from 2021/01 to 2021/07.

 

Also if the slicer YearMonth = 2020/07, the bar chart will only show from 2020/01 to 2020/07.

 

One thing needed to notice is that, I already made a one to many relationship between date table and the fact table with "Date" column. (Because I have other charts in this dashboard).

 

1.png

 

Thanks for your time.

 

Yun

4 REPLIES 4
v-chenwuz-msft
Community Support
Community Support

Hi  YunJ ,

 

There are two tables.

Fact table and date table, if you have created a relationship between them, then copy the date table without no relationship.

Fact table :

vchenwuzmsft_0-1630479178414.png

 

Date table:

vchenwuzmsft_1-1630479178415.png

 

1 Create a measure

Measure =

var Selectdate=SELECTEDVALUE('Date table'[Date])

return

CALCULATE(SUM([Value]),

        FILTER('Fact Table','Fact Table'[Year/month].[Year]=YEAR(Selectdate)&&'Fact Table'[Year/month]<=Selectdate)

)

 

2 Create a chart and put field Year/month in the Axis(Under the drop-down menu, leave the date hierarchy unchecked, as shown in the picture.), Measure in the Values.

vchenwuzmsft_2-1630479178424.png

 

3 Create slicer with the Date tables Date column(Similarly, do not select date hierarchy). Now you select a month and the chart will show the values before that month in the current year.

 

vchenwuzmsft_4-1630479282000.png

 

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

hi, may I have a demo?

hi, here the demo.

 

Best Regards

Community Support Team _ chenwu zhu

 

 

amitchandak
Super User
Super User

@YunJ , Are planning to select one period and want to show data more than that. Then you need an independent table

Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.