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
Anonymous
Not applicable

Amend measure to NOT Sum if values in another column are zero

Hi Expert

 

Need to amend the current measure so that it doesn't sum if the values in Net Amountr - if Allocation in Month has a corressponding zero value for that same row.

In the example below we have no zero values for each row in the Allocation in Month Column show the New Column Values Sum all the amounts in the Net Amount column to give us 50, if we have one zero value then the sum should return 40

Capture.PNG

 

 

 

 

 

My measure

New Column =
CALCULATE(
SUM(SampleData[Net Amount]),
ALLEXCEPT(SampleData,SampleData[Date] )
)
1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

You could create a column as follows:

New Column = CALCULATE(SUM([Net Amount]),FILTER(ALLEXCEPT(SampleData,SampleData[Date]),[Allocation in Month]<>0))

The final output is shown below:

vyalanwumsft_0-1626675937113.png

Best Regards,
Community Support Team_ Yalan Wu
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

3 REPLIES 3
v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

Is the above answer helpful to you? If so, Would you mind accept the helpful replies as solutions? Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-yalanwu-msft
Community Support
Community Support

Hi, @Anonymous ;

You could create a column as follows:

New Column = CALCULATE(SUM([Net Amount]),FILTER(ALLEXCEPT(SampleData,SampleData[Date]),[Allocation in Month]<>0))

The final output is shown below:

vyalanwumsft_0-1626675937113.png

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Tried 

New Column =
CALCULATE(
SUMX(SampleData,SampleData[Net Amount]),
ALLEXCEPT(SampleData,SampleData[Date],SampleData[Allocation in Month]
))
 
no luck

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.