cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Sum All Values in an If Statement

Hi, 

I created an if statment to use as a measure in a table, the column is 'Proj Sales Total' (See Full Table).

However, when the sum at the bottom is only totaling the 1st two rows (where the statement is true). 

 

FullTable.GIF

 

The measure for this field is: 

Proj Sales Total = If( [WrittenSales] > 0, [WrittenSales] * .9, [ForecastCalculation])

 

Here are the measures being used in the above calculation:

WrittenSales = Sum('Table1'[Sales])

ForecastCalculation = sum('Table2'[Forecast])

 

How do I get the total to sum all the rows?

If I make thismeasure a calculated column, I get the same incorrect result. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IV
Super User IV

Re: Sum All Values in an If Statement

@ahspowerbi try this measure

 

Total Proj Sales = 
SUMX ( VALUES ( Table[Fund Day] ), If( [WrittenSales] > 0, [WrittenSales] * .9, [ForecastCalculation]) )

 






Did I answer your question? Mark my post as a solution.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

1 REPLY 1
Highlighted
Super User IV
Super User IV

Re: Sum All Values in an If Statement

@ahspowerbi try this measure

 

Total Proj Sales = 
SUMX ( VALUES ( Table[Fund Day] ), If( [WrittenSales] > 0, [WrittenSales] * .9, [ForecastCalculation]) )

 






Did I answer your question? Mark my post as a solution.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

Helpful resources

Announcements
May 2020 Community Highlights

May 2020 Community Highlights

It’s time for another PBI Community recap!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!

Top Solution Authors