March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
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)
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.
Here are the [SOV] & [Budget] measures...
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.
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.
This measure works. It returns a 1 (100% overbudget) for the odd situation:
@newhopepdx
The above explanation is confusing, Can you provide a sample data and desired output.
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
User | Count |
---|---|
93 | |
87 | |
84 | |
77 | |
49 |
User | Count |
---|---|
163 | |
148 | |
103 | |
74 | |
55 |