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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

How to set up 3 Slicers for 3 types of date (columns)?

I have a fact table with 3 date columns, e.g.

6.PNG

 

I want to create 3 slicers for each of the 3 date columns for filtering.  For example:

  • when I check 2018 in the slicer for order-date and 'select all' for other 2 date slicers, I can see the sum(sales) for order-date-year=2018;
  • when I check 2018 in the slicer for ship-date and 'select all' for other 2 date slicers, I can see the sum(sales) for ship-date-year=2018;
  • when I check 2018 in the slicer for delivery-date and 'select all' for other 2 date slicers, I can see the sum(sales) for delivery-date-year=2018.

 

Should I create 3 date tables for joining with the 3 different date columns from the Fact table? Or is there an easy way to achieve the purpose?

 

 

2 ACCEPTED SOLUTIONS
jdbuchanan71
Super User
Super User

Hello @Anonymous 

Three copies of the data table will be the way to go I think.  If you have a date table already you can make a copy of it in DAX simply by going to Modeling > New Table and entering the code something like:

Ship Date Table = DateTable

After that you can rename the columns in the copy of the table so instead of 'Year' is it 'Ship Year' but you don't need to.

View solution in original post

v-lili6-msft
Community Support
Community Support

hi @Anonymous 

There are two ways for you refer to:

1. Create 3 date tables for joining with the 3 different date columns from the Fact table as you said, you could copy the date table twice as jdbuchanan71 said to get three date tables.

2. Unpivot the fact table then use only one date table, selected order-date column, ship-date column and delivery-date column, then unpivot these columns and use [Attribute] as a slicer and [Value] column to connect with date table.

https://radacad.com/pivot-and-unpivot-with-power-bi

 

Regards,

Lin

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

View solution in original post

5 REPLIES 5
v-lili6-msft
Community Support
Community Support

hi @Anonymous 

There are two ways for you refer to:

1. Create 3 date tables for joining with the 3 different date columns from the Fact table as you said, you could copy the date table twice as jdbuchanan71 said to get three date tables.

2. Unpivot the fact table then use only one date table, selected order-date column, ship-date column and delivery-date column, then unpivot these columns and use [Attribute] as a slicer and [Value] column to connect with date table.

https://radacad.com/pivot-and-unpivot-with-power-bi

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi, 

 

From what i understand, if you don't have the need to create a date dimension, you could use the 'date hierarchy' directly to filter for years. 

Capture.PNG

Anonymous
Not applicable

I can't directly use the 3 dates from the fact table for the 3 slicers; otherwise, an error is gonna pop up like: ...expects a contiguous selection when the date column is not unique...

Anonymous
Not applicable

Got you! Thank you 🙂

jdbuchanan71
Super User
Super User

Hello @Anonymous 

Three copies of the data table will be the way to go I think.  If you have a date table already you can make a copy of it in DAX simply by going to Modeling > New Table and entering the code something like:

Ship Date Table = DateTable

After that you can rename the columns in the copy of the table so instead of 'Year' is it 'Ship Year' but you don't need to.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.