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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

assign a slicer to a specific measure in a chart

Dears,

 

I have created a clusttered bar chart for 3 measures : Min Duration, Average Duration, DurationPerUserCode.
I have created 3 slicers :  "Owner Name", Current Owener Name", and "Area" from 2 columns of the "Main" table. "Owner Name", Current Owener Name" are by the Owener name colum of "Main" table, and Area from Area coulmn of Main table, in the data, for each Area there are several oweners. 
I want to have the chart so that, when I choose a name in the "Current Owener Name" slicer, only the coulmn of "DurationPerUserCode" that is belong to this measure change, and when I use "Owner Name" and "Area" I can see the changes only on "Min Duration", "Average Duration"

Thank you in Advance

3 REPLIES 3
djurecicK2
Super User
Super User

Hi @Anonymous ,

 You could look into using the DAX function ISFILTERED in your measures, so that they would only change depending on which fields are filtered with the slicer. 

Here is additional information:

https://dax.guide/isfiltered/

https://www.youtube.com/watch?v=iS6DdLnB0WQ

https://www.youtube.com/watch?v=DqehDO50mFE

 

 

Anonymous
Not applicable

I changed to it: AverageDuration = IF( ISFILTERED(MAIN[Well Name]), AVERAGEX( CALCULATETABLE( SUMMARIZE( MAIN, MAIN[Field], MAIN[Well Name], MAIN[User Code], "TotalDuration", SUM(MAIN[DurationPerHour]) ), REMOVEFILTERS(MAIN[Well Name]) ), [TotalDuration] ), AVERAGEX( SUMMARIZE( MAIN, MAIN[Field], MAIN[Well Name], MAIN[User Code], "TotalDuration", SUM(MAIN[DurationPerHour]) ), [TotalDuration] ) ) but still doent work!
Anonymous
Not applicable

To determine the duration of each single user code, the sum of the durations of that user code must be calculated in each well separately, then other addition, average and minimization operations should be performed on them. The data are as follow: 

 

 

Field

Well Name

User Code

DurationPerHour

CRL

CRL-1

RIH

1

CRL

CRL-1

RIH

4

CRL

CRL-1

DRL-2

1

CRL

CRL-1

DRL-2

3

CRL

CRL-1

BOP-1

1

GIN

GIN-1

RIH

3

GIN

GIN-1

DRL-2

2

GIN

GIN-1

DRL-2

5

GIN

GIN-1

BOP-1

1

CRL

CRL-2

RIH

2

CRL

CRL-2

DRL-2

4

CRL

CRL-2

DRL-2

3

MOS

MOS-2

RIH

4

MOS

MOS-2

DRL-2

2

MOS

MOS-2

BOP-1

1

and I wrote the DAXs as below, but only for your information, when I said "the durations of that user code must be calculated in each well separately" it means the following table result that should be considered for furthur calculations:

Field

Well Name

User Code

DurationPerHour

CRL

CRL-1

RIH

5

CRL

CRL-1

DRL-2

4

CRL

CRL-1

BOP-1

1

GIN

GIN-1

RIH

3

GIN

GIN-1

DRL-2

7

GIN

GIN-1

BOP-1

1

CRL

CRL-2

RIH

2

CRL

CRL-2

DRL-2

7

MOS

MOS-2

RIH

4

MOS

MOS-2

DRL-2

2

MOS

MOS-2

BOP-1

1

 
sum duration = SUM(MAIN[DurationPerHour])
Duration per Usercode = sumx(
    VALUES(MAIN[User Code]), CALCULATE(
        SUMX(MAIN, [sum duration]), ALLEXCEPT(MAIN, MAIN[User Code], MAIN[Well Name])
    )
)
 
Average Duration =
AVERAGEX (
    VALUES ( MAIN[Well Name] ),
    CALCULATE (
        [sum duration],
        ALLEXCEPT ( MAIN, MAIN[User Code], MAIN[Well Name] )
    )
) + 0
MIN Duration per Usercode = MINX(
    VALUES(MAIN[User Code]), CALCULATE(
        MINX(MAIN, [sum duration]), ALLEXCEPT(MAIN, MAIN[User Code], MAIN[Well Name])
    )
)
 
Although I may be able to use 
SUMMARIZE(
        MAIN,
        MAIN[User Code],
        MAIN[Well Name],
 
in my calculations)
 
Now I want to create a clustered column chart using the measures "Duration per Usercode"," Average Duration", "MIN Duration per Usercode" and create two slicers from "Field" and "Well Name" columns, respectively named "Area" and "Current Well Name", where the Area slicer is only on "Average Duration" and "MIN Duration per Usercode" and the "Current Well Name" slicer only affects "Duration per Usercode". And the results related to Average Duration and MIN Duration per Usercode, without considering the values ​​of the well selected by the Current Well Name slicer, are calculated and displayed.
By placing the "user codes" column in the filter section and filtering it for DRL-2 operation, display the number 20 for "Duration per Usercode" and the number 5 for "Average Duration" and the number 2 for "MIN Duration per Usercode" .
By keeping the "DRL-2" operation filter and by creating a slicer named "Current well Name" from the "well Name" column, and selecting the CRL-2 well, for the measure "Duration per Usercode" the number 7 and for the "Average Duration" the number 4.33 and for the "MIN Duration per Usercode" the number 2 to display.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors