cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BYENER
Helper IV
Helper IV

Switch between two different date columns in slicer

Hi All,

 

I have two date columns in my table and I am using a slicer in my report. So I will use the final date in my slicer when I choose for final date and otherwise.

 

Can someone help me?

 

Thanks in advance.

7 REPLIES 7
BYENER
Helper IV
Helper IV

@negi007 @AlB 

 

I have a date slicer and I have a chiclet visual (selectable: Final Date or Creation Date). When the end user clicks on "Final Date" than the slicer date should be based on Final date.

Example.jpg

 

Hi @BYENER ,

 

Based on your description, I can probably understand what you think.

It should be pointed out that measure cannot be used as slicer content. To switch slicer options, you could use bookmarks and buttons to switch reports.

https://radacad.com/bookmarks-and-buttons-making-power-bi-charts-even-more-interactive 

 

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

negi007
Super User II
Super User II

@BYENERI understand you wish to have unique values from two date columns which you want to use in your slicer.  You can create a new table, in powerbi desktop go to the New Table option and paste the below code. It will create a another table with unique date field from two date columns. 

 

SlicerDate =
FILTER (
    DISTINCT (
        UNION ( VALUES ( Table1[date_col_1] )VALUES ( Table1[date_col_2] ) )
    ),
    [SlicerDate ] <> BLANK ()
)



Did I answer your question? Mark my post as a solution!
Appreciate your Kudos


Proud to be a Super User!

Follow me here


@negi007 

 

No, let me explain. Every row has two dates, creation date and final date. I have a report overview where I want to filter on creation date and sometimes on final date. So for that I want to use a chicklet visual. If the user will use the final date in the slicer then he/she has to click first on date type "Final date" and after he/she can use the slicer. 

 

AlB
Super User III
Super User III

Hi @BYENER 

Can you explain with an example what you are trying to do exactly?

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

amitchandak
Super User IV
Super User IV

@BYENER , You need to join both of them with the date table and use userelation to switch it based on slicer selection

 

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Hi @amitchandak 

Do you mean a switch function in a measure? If yes, the slicer is not working with a measure?

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors