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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
newhopepdx
Helper I
Helper I

Matrix data disappearing

I'm trying to create a Measure to yield the proper % Over Budget. The SOV table is consists of amounts that are classed (via a column) as "Budgeted", "Change Orders" & "Over-Budget". My first stab at the measure worked, except that items that have no budget and no SOV value show up as 100% over budget.  Version 1 was: Over Budget = DIVIDE( [Budget] - [SOV], [Budget], 1) 

p2.jpg

p3.jpg

When I add logic to the measure using an IF() statement to correct this a whole section of the data disappears (bottom of the image, section beginning with "A-Architectural"). See the second image to see data with the original measure.

Zero.jpg

PreZero.jpg

Here are the [SOV] & [Budget] measures...

budget.jpgSOV.jpg

4 REPLIES 4
newhopepdx
Helper I
Helper I

I figured out what was happening.

Following the measure's Return statement I had this IF() function: IF( FinalAmount < 0, ABS(FinalAmount). With the measure written that way, all the rows where the result was zero (for some reason) caused the two columns to the left (Budget and SOV values) to disappear.

Simply moving that IF() above Return and assigning it to anohter VAR, and then returning that last VAR, made everything work perfectly. Rows with Budget & SOV greater than zero where SOV > Budget have % overbudget, other rows have nothing in that column.

 

Aparently DAX doesn't like two functions being computed in the returned value.

newhopepdx
Helper I
Helper I

Yes, that's fine for all situations except where there is a zero budget and a change order has created $$s in the SOV. In the image below Y-PCC0#001 should be 100%. That's why I was attempting to add an IF() condition to the measure to cover that situation.

 

p1.jpgp2.jpg

 

This measure works. It returns a 1 (100% overbudget) for the odd situation:

Over Budget =
VAR LessThanBudgeted = DIVIDE([Budget]-[SOV],[Budget],0)
Return
    IF(AND([SOV] > 0, [Budget] = 0), 1, LessThanBudgeted)
 
Just curious that the other measure caused non-related rows to vanish.
Thanks for your help.

@newhopepdx 

The above explanation is confusing, Can you provide a sample data and desired output.

NaveenGandhi
Super User
Super User

Hello @newhopepdx 

 

Is there a reason why you using 1 for alternate result in divide function? Just doing this change in your first version of the measure should work.

 

DIVIDE( [Budget] - [SOV], [Budget], 0) 

 

Appreciate your Kudos!

If this helps, please mark this as solution.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.