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
strider34
New Member

Running total of calculated column

Hello,

 

I'm trying to create a calculated column called OpenNCs in a table called NCDelta.  The OpenNCs column is intended to show a running total of another calculated column, NCDiff, in the same table.  It says a circular dependency was detected and I'm a noob so I haven't been able to figure this out.  The below picture shows my formula and the error.  In the "OpenNCs" column I would like to have it show 6, 7, 37...

strider34_0-1617386536960.png

Here is the formula in the other calculated column.

strider34_1-1617386933699.png

What the NCDiff formula does is look at two other tables and subtracts the number of records that were counted as opened and closed on a date, providing the difference.  I am trying to use this difference to show the total number of records that were open on a given day.  (Note that I changed the Table names for the screenshot, causing a lot of red underlines).

1 ACCEPTED SOLUTION
strider34
New Member

I was able to solve this by deleting the "OpenNCs" column and creating a running total using Quick Measure where I selected "NCDiff" for the Base Value and "Date" for the Field.  I guess I learned my lesson with going crazy with calculated columns.

View solution in original post

3 REPLIES 3
strider34
New Member

I was able to solve this by deleting the "OpenNCs" column and creating a running total using Quick Measure where I selected "NCDiff" for the Base Value and "Date" for the Field.  I guess I learned my lesson with going crazy with calculated columns.

CNENFRNL
Community Champion
Community Champion

@strider34 , as far as I'm concerned, I avoid, whenever possible, using CALCULATE/CALCULATETABLE in a calculated column; so that merely row context takes effect when authoring a DAX formula.

 

In your case, you might want to try,

OpenNCs =
SUMX (
    FILTER ( NCDelta, NCDelta[Date] <= EARLIER ( NCDelta[Date] ) ),
    NCDelta[NCDiff]
)

Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

@CNENFRNL, thanks for the suggestion.  I tried using your formula and still got the error though:

 

strider34_0-1617394844091.png

 

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.