Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
I have created a clustered bar chart for 3 measures : MIN Duration per Usercode, Average Duration, DurationPerUserCode.
I have created 2 slicers : “Current well Name", and "Area" from 2 columns of the "Main" table: "Well Name", and “Field” so that for each Field there are several wells.
I want to have the chart so that, when I choose a name in the " Current well Name " slicer, only the column of "DurationPerUserCode" that is belong to this measure change, and when I use "a field name" from "Area" slicer, I can see the changes only on " MIN Duration per Usercode ", "Average Duration"
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.
Thank you in Advance
Solved! Go to Solution.
Hi @professional65 ,
Based on my testing, please try the following methods again:
1.Create the simple tables.
2.Create the new table.
3.Create the new measure to filter the user code selected.
Measure =
var sel_ = SELECTEDVALUE('Table user code'[User Code])
var tal_s = VALUES('Table'[User Code])
RETURN
IF(tal_s = sel_, 1, 0)
4.Drag the measure into the column chart Filters pane. Enter the values is 1.
5.Select the DRL-2 in the slicer.
6.Select the CRL-2 in the current well name.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @professional65 ,
Based on my testing, please try the following methods again:
1.Create the simple tables.
2.Create the new table.
3.Create the new measure to filter the user code selected.
Measure =
var sel_ = SELECTEDVALUE('Table user code'[User Code])
var tal_s = VALUES('Table'[User Code])
RETURN
IF(tal_s = sel_, 1, 0)
4.Drag the measure into the column chart Filters pane. Enter the values is 1.
5.Select the DRL-2 in the slicer.
6.Select the CRL-2 in the current well name.
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
9 | |
8 | |
8 | |
7 |