cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Switch between two date columns based on a slicer

I have a table with two date columns, one for "sale date" and another for product usage as "product start date". 
I have several plots/tables nicely arranged but I have to duplicate each page based on whether I am looking for "sales date" or "product start date". This is creating un-necessary page/tabs. Not to mention I have several calculations going on based on each of these date type, so they too are getting duplicated.

I tried every possible way to have a slicer to switch between "sales date" and "product start date" but failed.
It would have worked nicely if "SELECTEDVALUE" function worked with "CALCULATED COLUMN" as then I could have just created a column based on the selected slicer and all calculations/pages would just be based on this one "CALCULATED COLUMN"

Tried to search all over but it seems most places they say, no solution. I am hoping to be wrong. One such depressing post was below:
https://community.powerbi.com/t5/Desktop/Toggle-between-fiscal-and-calendar-year-using-slicer/m-p/77...

 

6 REPLIES 6
Resolver III
Resolver III

@AnshulGupta 

 

Good day,

Try this.. 

1. Create a disconnected table with only two values 1. Sales Date & 2. Product Start Date (no need to create any relationship with any other tables)

2. Add this as slicer in your report

3. Create measures, in measure use if (selectedvalue(slicer)="SalesDate" , use sales date, use product start date)

 

Hope this will help.

 

Thanks & Regards,

Mohammed Adnan

www.youtube.com/taik18

I already tried this. Unfortunately, measure doesn't let use the column as it is. But may be I am getting it wrong. So, please tell me exact DAX command for your step 3.

Hi @AnshulGupta

Pls send me the column what you have written for now.

Thanks & Regards,

Mohammed Adnan

I am afraid you are asking me something which actually I am seeking help for.

I do not yet know how to tag a column out of a slicer selection. It only seems to work for a measure.

Again, my need is, if slicer selection is "sales date", then for any further work "sales date" column should be used. And if slicer selection is "start date", then for any further work "start date" column should be used. Please send me DAX program for the same. Appreciate that.

Hi @AnshulGupta ,

 

There are some posts about dynamic change in x axis. Not the same, but may help:

Dynamic change in X Axis;

Dynamic Attributes In A Power BI Report.

 

 

Best regards

Icey

 

If this post helps, then consider Accepting it as the solution to help other members find it faster.

Thank you. I actually thought about these possibilities but this requires me to duplicate the entire data. Unfortunately, my data is not small within single tables. I have more than 100k rows, many tables and each with 20-30 columns. So, duplicating the dataset would make it unmanageable. Thank you for reminding me of this possibility though.

Helpful resources

Announcements
secondImage

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

secondImage

Power BI Women

Join our monthly meetings and learning sessions.

secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors