Reply
Pintobean80
Regular Visitor
Partially syndicated - Outbound

I want to create a single date slicer that affects two charts that each use a different date column.

So I have a single page with two charts in it. Each chart is using a different date column (one chart is using "candy arrival date" column and the other is using "drink arrival date" column).

 

I want to create a year slicer and a quarter slicer that will affect both charts at the same time. How do I go about doing that? I've been trying to wrap my head around this and can't figure it out.

5 REPLIES 5
v-huijiey-msft
Community Support
Community Support

Syndicated - Outbound

Hi @Pintobean80 ,

 

Hope you are doing well.

 

Please follow these steps:
1. First, two charts containing "candy arrival date" and "drink arrival date" were created.

vhuijieymsft_0-1705049518955.png

2. Extracts the union of the year and quarter of the date columns of two tables.

vhuijieymsft_1-1705049543252.png
vhuijieymsft_2-1705049543253.png

3. Add two calculated columns to the candy table and drink table respectively, representing the year and quarter. This is so that we can better establish the relationship between tables when modeling data.

vhuijieymsft_3-1705049613639.png
vhuijieymsft_4-1705049613642.png

4. Perform data modeling and establish relationships between tables.

vhuijieymsft_5-1705049641319.png

5. Add quarterResult and yearResult to the slicer respectively, and then you can filter based on year and quarter.

vhuijieymsft_6-1705049669512.png

vhuijieymsft_7-1705049669515.png


I would be grateful if you can reply to me at your earliest convenience.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

Syndicated - Outbound

I'm sorry, I should have mentioned that both of these date columns are on the same table. Would that change the approach you mentioned?

Syndicated - Outbound

Hi @Pintobean80 ,

 

Thank you very much for your prompt reply.

 

I don’t quite understand something about the two dates you mentioned being listed in the same table. I would be very grateful if you could reply to me when you are free:

 

Are your two date columns the same date in each row? Or a different date?

 

If they are the same dates, filter one of the columns to achieve the effect you want.

 

If the dates in the two columns are different, I think I need to give you an example to explain my doubts:

 

If in the second row of the table, the candy arrive date is 12/31/2022, and the drink arrive date is 1/12/2021, when 2021 is filtered in the slicer, the candy arrive date will display the data for 2022, but you are The slicer does not filter out 2022, and the logic at this time is not smooth.

 

I would appreciate it if you could provide a copy of the Power BI Desktop file.

 

Looking forward to your reply and wishing you all the best.

 

Warm Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

amitchandak
Super User
Super User

Syndicated - Outbound

@Pintobean80 , You need to create a date table with the required columns And join both dates(without timestamp) with that date table. Suppose they are from different tables. You can now use the Date Table columns in the slicer. If they are in the same table. one join will be inactive and you can use USERELATIONSHIPto enable another join

 

example

CALCULATE(SUM(Table[Value]),USERELATIONSHIP('Table'[Date],[Date])

 

examples of USERELATIONSHIP

Power BI: HR Analytics - Employees as on Date : https://youtu.be/e6Y-l_JtCq4
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
Power BI HR Active Employee Tenure Bucketing, and Hired, Terminated, and Active employees: https://youtu.be/fvgcx8QLqZU

 

Date Table

https://community.powerbi.com/t5/Community-Blog/Creating-Financial-Calendar-Decoding-Date-and-Calend...
https://medium.com/chandakamit/cheat-sheet-calendar-of-any-standard-month-just-one-variable-apart-5e...
https://amitchandak.medium.com/cheat-sheet-power-query-financial-year-calendar-5ceaacb520f1

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Syndicated - Outbound

Both dates are on the same table. Would that complicate things?

avatar user

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)