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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
thomazinh
Helper I
Helper I

HELP - Fixed Amount Dynamically Change Based On Slicer Selection

I have two tables in my simplified example problem, JobIDAmount and JobIDTable. The JobIDTable is a table record of the Job Name and the ID Alpha associated to the corresponding names so that the data in JobIDAmount can be filtered by the Job Name. I am running a fixed denominator calculation so I can find the percent associated by that denominator for each ID Discipline in the JobIDTable. 

 

I need help dynamically changing the fixed denominator when a new ID Name is chosen in the slicer panel. Right now, I am only able to return the total amount for the fixed demoniator when I need to only return the total amount for only that ID Name selected. 

 

thomazinh_3-1646063506684.png

 

If I Filter the page by ID Name, Alpha 1671, I expect the Fixed Denominator Measure Amount to be 22 (not 162) and the values in Table 6 to be:

 

AmountID Discipline1_Division
7A0.32
4B0.18
12C0.54
3D0.13
13E0.59
3F0.14

 

My Measures are:

 

1_Division = DIVIDE([1_SumAmount],[1_SumFixed],0)

 

 

 

1_SumAmount = SUM(JobIDAmount[Amount])

 

 

 

1_SumFixed = 
VAR _Filter = FILTER(ALL(JobIDAmount), JobIDAmount[ID Discipline] IN {"A" , "C" , "D"})
VAR _1 = CALCULATE([1_SumAmount],_Filter)
RETURN
_1

 

 

Here is the sample file. The link will eventually expire. Please tag me if the problem statement is unclear. Thank you in advance for your help. 

 

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @thomazinh ,

 

You issue is related with the last formula since you are using ALL the filter context is removed and you get the full table returning always the same value redo your measure to using ALLSELECTED you get expected result:

 

1_SumFixed = 
VAR _Filter = FILTER(ALLSELECTED(JobIDAmount), JobIDAmount[ID Discipline] IN {"A" , "C" , "D"})
VAR _1 = CALCULATE([1_SumAmount],_Filter)
RETURN
_1

 

MFelix_0-1646065530160.pngMFelix_1-1646065544695.png

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

2 REPLIES 2
MFelix
Super User
Super User

Hi @thomazinh ,

 

You issue is related with the last formula since you are using ALL the filter context is removed and you get the full table returning always the same value redo your measure to using ALLSELECTED you get expected result:

 

1_SumFixed = 
VAR _Filter = FILTER(ALLSELECTED(JobIDAmount), JobIDAmount[ID Discipline] IN {"A" , "C" , "D"})
VAR _1 = CALCULATE([1_SumAmount],_Filter)
RETURN
_1

 

MFelix_0-1646065530160.pngMFelix_1-1646065544695.png

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Thank you! I can't believe this was such a simple solution. I totally forgot about ALLSELECTED. 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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