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

Remaining fee total of measure and date issues

I've got a couple problems with a model of mine.  The first issue is that I'm trying to calculate the total of a measure which is calculating the remaining fee (aka backlog) for a given project.  That measure is taking the contractual fee and subtracting a measure that calculates the running total of all transactions against that contract to arrive at remaining fee.  If the remaining fee drops below zero (aka over budget), then the remaining fee is zero, not a negative number.  My measures work fine on an individual project basis, but I need to sum up all projects to get a total remaining fee across the company, which doesn't work.

 

The second issue I don't understand is that when I drill down below the monthly level to the day level I seem to lose data.  In the end I want to chart this on a week to week basis across at least the last 52 weeks so this is going to be an issue.

 

The data is in three tables.  The first table (PRSimple) contains the project number (WBS1), project fee (FeeDirLab), and the project creation date (CreateDate).  The second table (LDSimple) contains the project number (WBS1), transaction value (BillExt), and transaction date (TransDate).  The third table is a date table (DateTable).

 

There is a date relationship between the date table and the transaction date in LDSimple.  There's a project number relationship between PRSimple and LDSimple using WBS1.

 

Here's a link to download a sample model with similar but fake data...

 

I've reviewed many different methods for a total of a measure including the GregDeckler blog article, but something isn't working.  The measure currently in the model is the simple version that works at the project level and doesn't include the HASONEVALUE trick or anything else.  Any help is appreciated.

2 ACCEPTED SOLUTIONS
Bmejia
Super User
Super User

Sorry tried to reply sooner I believe this should help you out if you not already resolved this issue.  Is off by one dollar cause I believe is the actual sum. 

Create a measure like this I am reusing all your current measures.

NewBacklog =
IF(HASONEVALUE(PRSimple[FeeDirLab]),[Backlog], --Calculates what is already correct
SUMX(PRSimple, -- Calculates the Total value
    IF(CALCULATE(SUM(PRSimple[FeeDirLab]))-[TotalBilling]>0,
        CALCULATE(SUM(PRSimple[FeeDirLab]))-[TotalBilling],0)))

View solution in original post

Hi, @dafrey23 

 

You can try the following methods. 

Measure:

Measure = 
Var _table=SUMMARIZE(PRSimple,PRSimple[WBS1],"Value",[Backlog])
RETURN
SUMX(_table,[Value])

vzhangtinmsft_0-1721713713683.png

Is this the result you expected?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Bmejia
Super User
Super User

Sorry tried to reply sooner I believe this should help you out if you not already resolved this issue.  Is off by one dollar cause I believe is the actual sum. 

Create a measure like this I am reusing all your current measures.

NewBacklog =
IF(HASONEVALUE(PRSimple[FeeDirLab]),[Backlog], --Calculates what is already correct
SUMX(PRSimple, -- Calculates the Total value
    IF(CALCULATE(SUM(PRSimple[FeeDirLab]))-[TotalBilling]>0,
        CALCULATE(SUM(PRSimple[FeeDirLab]))-[TotalBilling],0)))

This seems to work perfectly.  Now I need to study up on why, but that's my problem.

 

Thanks so much.

Bmejia
Super User
Super User

dafrey23,

It would be helpful if you provide a sample visual of what is wrong and what values you are expecting to see where you see the wrong data.  I think right now we all looking at your backlog measure and it seem correct as you mention, but we don't know where is wrong or what the expected output is.

Thanks,

Certainly.  The problem is the totals are summing up all the fees and subtracting the sum of all the transactions.  However on any individual project if the sum of the transactions is greater than the fee, then the value should zero, not a negative number.  So the totals should be summing up all the non-negative numbers. This behavior is indicated when the total at the bottom is less than the sum of the individual projects.

 

Screenshot 2024-07-18 164633.jpg

Hi, @dafrey23 

 

You can try the following methods. 

Measure:

Measure = 
Var _table=SUMMARIZE(PRSimple,PRSimple[WBS1],"Value",[Backlog])
RETURN
SUMX(_table,[Value])

vzhangtinmsft_0-1721713713683.png

Is this the result you expected?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

This also works.  Thanks.

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.