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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Measures in slicers

Hi,

I have a dataset (shorter version) with the following values:

The dataset is about Surveys where PID is assigned to one survey. Cycle time is a difference between 2 milestones expressed in days/weeks/months.

tvadoc_0-1666699596715.png

I'd like to create 3-3 slicers where I can change the measure and time span:

tvadoc_1-1666699615890.png

So basically, if I select Avg and Day, then on my Diagram, it'd show the Avg and the Day for each surveys, while the year is in the X axis, like this:

tvadoc_2-1666699780349.png

 

I tried with some DAX, but I'm not sure if this is the way. 

So basically I have a Measure selector and a Time span selector, and the following code copied for both:

 

tvadoc_3-1666699967679.png

 

 

Time span selection = SWITCH( TRUE(),
    AND(VALUES('Time span selector'[Time span selector]) = "Day", VALUES('Measure selector'[Measure selector]) = "Avg"), AVERAGE(final[Cycle time - DAYS]),
    AND(VALUES('Time span selector'[Time span selector]) = "Week", VALUES('Measure selector'[Measure selector]) = "Avg"), AVERAGE(final[Cycle time - WEEKS]),
    AND(VALUES('Time span selector'[Time span selector]) = "Month", VALUES('Measure selector'[Measure selector]) = "Avg"), AVERAGE(final[Cycle time - MONTHS]),
    AND(VALUES('Time span selector'[Time span selector]) = "Day", VALUES('Measure selector'[Measure selector]) = "Min"), MIN(final[Cycle time - DAYS]),
    AND(VALUES('Time span selector'[Time span selector]) = "Week", VALUES('Measure selector'[Measure selector]) = "Min"), MIN(final[Cycle time - WEEKS]),
    AND(VALUES('Time span selector'[Time span selector]) = "Month", VALUES('Measure selector'[Measure selector]) = "Min"), AVERAGE(final[Cycle time - MONTHS]),
    AND(VALUES('Time span selector'[Time span selector]) = "Day", VALUES('Measure selector'[Measure selector]) = "Max"), AVERAGE(final[Cycle time - DAYS]),
    AND(VALUES('Time span selector'[Time span selector]) = "Week", VALUES('Measure selector'[Measure selector]) = "Max"), AVERAGE(final[Cycle time - WEEKS]),
    AND(VALUES('Time span selector'[Time span selector]) = "Month", VALUES('Measure selector'[Measure selector]) = "Max"), AVERAGE(final[Cycle time - MONTHS]),
    BLANK())

 

Is this how I'm supposed to do this so I can get the desired result?

 

Thank you for your help!

2 REPLIES 2
johnt75
Super User
Super User

I think you can do this with a couple of fields parameters. Create separate measures for the average, min and max and add them to one fields parameter. Pick the different columns you want to use from your date table and add those to another fields parameter, and then put the 2 different fields parameters on the axes of your chart.

Anonymous
Not applicable

Thank you for your answer, but I still need a little help:

 

"Create separate measures for the average, min and max and add them to one fields parameter"

 

So if I create a measure for the average, minimum, maximum, should that be? (final is my table name):

Avg Cycle time (days) = AVERAGE(final[Cycle time - DAYS]
Min Cycle time (days) = MINIMUM(final[Cycle time - DAYS]) 
Max Cycle time (days) = MAXIMUM(final[Cycle time - DAYS]) 
And then the same for Cycle time weeks and months?
 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.