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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
enswitzer
Helper III
Helper III

Filter Calculation - MUST BE NEW COLUMN

I have a set of data that I am going to want to filter by (ultimately going to put this calculation into an if statement to determine if it's overbudget and want to be able to slice by the red/yellow/green output).

 

The data looks like this, and I have created a formula (overbudget) that right now just sums everything by the project ID, however I want use it to say the following for each project ID:

 

If (Sum of Expenditure (type = target) >= sum of Expenditure (type = trend), "On Plan", "Overbudget")

 

 

Overbudget (CURRENTLY) = Calculate(Sum('PP - Project Status: Spend Chart'[Value]), ALLEXCEPT('PP - Project Status: Spend Chart', 'PP - Project Status: Spend Chart'[Project IDId]))

 

 

enswitzer_0-1607955243333.png

 

I seem to have no issues doing this as measures - but get stuck trying to do it as a new column. 

3 REPLIES 3
enswitzer
Helper III
Helper III

@Greg_Deckler 

Looking to create the Overbudget column just not as a measure. 

 

enswitzer_0-1607956816125.png

 

Current measure formulas:

 

Total Budget =
CALCULATE (
[Total Value],
'PP - Project Status: Spend Chart'[Expenditure Type] = "Target"
)
 
Total Trend Spend =
CALCULATE (
[Total Value],
'PP - Project Status: Spend Chart'[Expenditure Type] = "Actual"
)
+ CALCULATE (
[Total Value],
'PP - Project Status: Spend Chart'[Expenditure Type] = "Trend"
)
 
Overbudget Measure = if([Total Budget]>=[Total Trend Spend], "On Plan", "Over Budget")

 

 

I don'@enswitzer,

You can create a measure as follows:

Measure = 
var _totalbudget=CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[Project ID]=MAX('Table'[Project ID])&&'Table'[Expenditure Type]="Target"))
var _totaltrendspend=CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[Project ID]=MAX('Table'[Project ID])&&'Table'[Expenditure Type]="Trend"))
Return
IF(_totalbudget>=_totaltrendspend,"On Plan", "Overbudget")

And you'll see:

v-kelly-msft_0-1609404493413.png

For the related .pbix file, see attachment pls.

Saludos
Kelly

Have I answered your question? Mark my position as a solution!

Greg_Deckler
Super User
Super User

@enswitzer So given the data above, what would this new column be for each row?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

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!

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.