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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
BossCo
Helper II
Helper II

Column depending on a measure or slicer.

Hi everyone! In my model, I have a dimension table with three columns: item, begin date, end date. I have a slicer for the items, with multiple selection allowed. I need to create a slicer for the dates also, where the begin date needs to be the last of the begin dates of the selected items, and the end date needs to be the first of the end dates of the selected items. How could I do? Any help appreciated, I hope it is clear enough, if it's not just let me know. Thanks!
1 ACCEPTED SOLUTION

Hi @BossCo ,
 
Unfortunately, measure cannot be used directly as a slicer and cannot use the values of multiple columns in the same slicer.
 
Best Regards,
Liang
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

6 REPLIES 6
V-lianl-msft
Community Support
Community Support

Hi @BossCo ,

 

Based on your description, you want to get the last start date and the first end date of each project, and then use them as slicers.You need to create two calculated columns:

last_start = CALCULATE(
                MAX(Sheet2[Stage Start]),
                FILTER(
                    ALLSELECTED(Sheet2),
                    EARLIER(Sheet2[QuoteID])=Sheet2[QuoteID]))

 

first_end = CALCULATE(
                MIN(Sheet2[Stage End]),
                FILTER(
ALLSELECTED(Sheet2),
                    EARLIER(Sheet2[QuoteID])=Sheet2[QuoteID]
))
 

You can refer to the pbix.

 

Best Regards,

Liang

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

Hi V-lianl-msft, my problem is slightly different. I hope to make it clearer now.

 
 
 

 

Project 11/11/1910/12/19
Project 25/11/198/12/19
Project 33/11/1910/12/19
Project 44/11/198/12/19
Project 51/11/199/12/19

 

Now, I simply have a slicer for the projects, like this:

 

Screen 2.png

 

What I want is a slicer for the dates, also, based on a calendar table, so that I can filter my fact table (sales) for date and project(s).

 

Screen 3.png

 

I created two measures: 

StartMeasure = LASTDATE(Sheet 2[BeginDate])
EndMeasure = FIRSTDATE(Sheet2[End Date])
 
These measures, of course, vary based on the project slicer, and it's perfect.
 
I want the date slicer to only show me values going from StartMeasure to EndMeasure, so varying based on the project slicer.

More basically, I would like the date slicer to show me only dates included in each project selected on the project slicer.

Thanks!

Hi @BossCo ,
 
Unfortunately, measure cannot be used directly as a slicer and cannot use the values of multiple columns in the same slicer.
 
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ok thanks, I'll create two card visuals with the begin and the end date and a warning:

"Please, for coherent data DO NOT SELECT dates outside of this range".

 

😂

 

Thanks!

JarroVGIT
Resident Rockstar
Resident Rockstar

You could create Card visuals with the following measure:

 

MeasureBeginDate = MAX(Table[begindate])
MeasureEndDate = MIN('Table'[begindate])

 

Should work when you apply filters, it does in my short test:

The table is to show all values in my test and is unaffected by the slicerThe table is to show all values in my test and is unaffected by the slicer

 

Kind regards

Djerro123

-------------------------------

If this answered your question, please mark it as the Solution. This also helps others to find what they are looking for.

Keep those thumbs up coming! 🙂





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

Proud to be a Super User!




Hi djerro, thanks for the answer.

 

Yes indeed, it works for the card visual.

 

My problem is that I should create another date slicer, based on a calendar table, which only shows me dates from the MeasureBeginDate until the MeasureEndDate, that's the point 🙂

Thanks for the answer, I hope it's more clear now 🙂 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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