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
dreambeforeyou
Frequent Visitor

DAX Help needed - Whatif Parameter in Measure returning too many rows in child table

Here is a link to my code - https://drive.google.com/file/d/1-Ue0OVG2C-oPRK8GPKkgO0WwsW_8Z4mU/view?usp=share_link

 

dreambeforeyou_0-1675287624483.png

I have a Whatif slider, Adjusted Hours.  If a number is put into that slider, I want to create a dynamic value from the "Operation Hours" in my Packages table, using a measure.

 

Revised Hrs =

    IF('Adjusted Hrs'[Adjusted Hrs Value] = 0, SELECTEDVALUE(Packages[Operation Hours]),
        'Adjusted Hrs'[Adjusted Hrs Value])

 

But as soon as I put the Revised Hrs into my table, it returns all the Packages, instead of using the Filter from the selected Allocation (AllocationID=106)

 

dreambeforeyou_1-1675288019216.png

 

Please could you help, I've tried so many options?  Calculate, SUMX, trying to find how to do Rowlevel filtering.

 

I will then be doing the calculation/adjustment in each record of the the PackageDetail child table.

 

Thank you

Tracey

2 REPLIES 2
amitchandak
Super User
Super User

@dreambeforeyou , Try like

 


Revised Hrs =

IF( not(isblank('Adjusted Hrs'[Adjusted Hrs Value])) && 'Adjusted Hrs'[Adjusted Hrs Value] = 0, SELECTEDVALUE(Packages[Operation Hours]),
'Adjusted Hrs'[Adjusted Hrs Value])

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hi Amit,

Thanks so much for looking at my problem.  And yes, I so know I needed to fix the logic of the expression to check for both.  I really appreciate your help.

BUT, my actual issue is that when I use the Measure in my table, it ignores the filter of the Allocation ID and returns all rows.

So I want this, plus the [Revised Hrs]

dreambeforeyou_0-1675310840397.png

But instead when I add [Revised Hrs] to the table, I get this:

dreambeforeyou_1-1675310909005.png

How do I only return the 5 value for the single row?

Thanks again,
Tracey

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

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.