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
newhopepdx
Helper II
Helper II

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 II
Helper II

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 II
Helper II

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
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!

November Carousel

Fabric Community Update - November 2024

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

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.