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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.