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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
dejadpower
Helper I
Helper I

change values based on slicer irrespective of other selections

Hello All,

In the power bi report given below ,When I change the job no slicer, the table lists the work orders for the selected job, and the starttime , endtime, duration measures shows the earliest starttime and latest endtime and difference in days respectively for all the items of the selected job. It works fine, but when i click on any work order on the table, it shows correct starttime, endtime , days for the selected work order...at the same time if I select different job in the slicer above, the measure values still points to the old selected work order (which will not be available on the table) , I have to click on clear selections before selecting the other job from the slicer.

 

My purpose is if I select any job in the slicer  -> the start,end time, days measure should show earliest start and latest end, difference for all available work orders for the selected job. If any work order is selected from the table, and I choose diffrent job from the slicer, the measures should clear the old selection.

 

how to clear the old selection when a job is selected in the slicer?

 

dejadpower_0-1716451946785.png

 

Start time O = var xx = if(  ISFILTERED(Workorder[Work Order Number]),  MINX(Booking, 'Booking'[starttime] ),CALCULATE(MINX(Booking,Booking[starttime]),REMOVEFILTERS(Workorder[Work Order Number]))) RETURN xx
 
End time O = if(ISFILTERED(Workorder[WO Number]), CALCULATE( MAXX(Booking, 'Booking'[endtime] ),FILTER(Workorder,Workorder[WO Number])),CALCULATE(MAXX(Booking,Booking[endtime]),REMOVEFILTERS(Workorder[WO Number])))
 
Total Diff O = if(ISBLANK([Start time O]),"0 Day", CONCATENATE(DATEDIFF([Start time O],[End time O],DAY)+1 ," Day(s)"))
 
I'm new to DAX . Thanks for any help 🙏
 
 

 

1 ACCEPTED SOLUTION
v-kaiyue-msft
Community Support
Community Support

Hi @dejadpower ,

 

By default, visualisations on the report page cross-filter and cross-highlight other visualisations on the page.
If you have editing rights to the report, you can turn on the Visual Interactions control and then customise how the visuals on the report page filter and highlight each other. More details can be found in the documentation: Change how visuals interact in a report - Power BI | Microsoft Learn.

vkaiyuemsft_0-1716538631212.png

 

Alternatively, try using the ALLSELECTED function, which gets a representation of the context of all the rows and columns in the query, while preserving the context outside of the explicit filters and row and column filters. This function can be used to get visual totals in a query. More details can be found in the documentation: ALLSELECTED function (DAX) - DAX | Microsoft Learn.

 

Start time O = 
VAR IsJobFiltered = ISFILTERED(Workorder[Job Number])
VAR MinStartTime = CALCULATE(MIN(Booking[starttime]), ALLSELECTED(Workorder[Work Order Number]))
RETURN IF(IsJobFiltered, MinStartTime, BLANK())

 

If these didn't solve your problem. Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

 

Best Regards,

Clara Gong

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

1 REPLY 1
v-kaiyue-msft
Community Support
Community Support

Hi @dejadpower ,

 

By default, visualisations on the report page cross-filter and cross-highlight other visualisations on the page.
If you have editing rights to the report, you can turn on the Visual Interactions control and then customise how the visuals on the report page filter and highlight each other. More details can be found in the documentation: Change how visuals interact in a report - Power BI | Microsoft Learn.

vkaiyuemsft_0-1716538631212.png

 

Alternatively, try using the ALLSELECTED function, which gets a representation of the context of all the rows and columns in the query, while preserving the context outside of the explicit filters and row and column filters. This function can be used to get visual totals in a query. More details can be found in the documentation: ALLSELECTED function (DAX) - DAX | Microsoft Learn.

 

Start time O = 
VAR IsJobFiltered = ISFILTERED(Workorder[Job Number])
VAR MinStartTime = CALCULATE(MIN(Booking[starttime]), ALLSELECTED(Workorder[Work Order Number]))
RETURN IF(IsJobFiltered, MinStartTime, BLANK())

 

If these didn't solve your problem. Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.

 

Best Regards,

Clara Gong

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.