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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
kg4u
Helper II
Helper II

Sum with multiple criteria

Hi,

 

I have reviewed and searched on this forum for ideas and suggestions.  While I did find a couple of suggestions which I thought would work, neither option I found is giving me the results as expected.

 

I have been trying to get a sum work with multiple criteria.  I have tried both the following formulas. Both of these formulas are seem to be correct in desktop, meaning I am not getting an error on the actual syntax of these formulas. 

 

This formula does give a result, however it is not the correct result.

Quality Sales = CALCULATE(

[Total Sales],

'Fact Agency Data'[Status] in {"Issue Paid", "Issue Paid|ARF", "Issue Paid|PDR", "Issued Paid|NY PIF", "Issued Paid|PDR|NY PIF" }

)

 

This formula doesn't return any results.

Quality Sales2 = CALCULATE(
SUM('Fact Agency Data'[Original Sales]),
FILTER ('Fact Agency Data','Fact Agency Data'[Status] = "Issue Paid"),
FILTER ('Fact Agency Data','Fact Agency Data'[Status] = "Issue Paid|ARF"),
FILTER ('Fact Agency Data','Fact Agency Data'[Status] = "Issue Paid|PDR"),
FILTER ('Fact Agency Data','Fact Agency Data'[Status] = "Issue Paid|NY PIF")
)
 
Total Sales = Sum ('Fact Agency Data'[Original Sales])
 
I am simply trying to get the value [Total Sales] when the [Status] = A or B or C or D, can someone give a suggestion on how to create this simple measure?
 
Many thanks to you power users 🙂
1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@kg4u you are using wrong value in your measure, missing "d" from some of the value, here is the correct measure. Pay attention to your data.

 

Quality Sales = 
CALCULATE (
    [Total Sales],
    KEEPFILTERS (
        'Quality Data'[Status] in { "Issued Paid", "Issued Paid|ARF", "Issued Paid|PDR", "Issued Paid|NY PIF", "Issued Paid|PDR|NY PIF" }
    )
)

 

and here is the output

 

parry2k_0-1664466581140.png

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.

 

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


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

8 REPLIES 8
parry2k
Super User
Super User

@kg4u you are using wrong value in your measure, missing "d" from some of the value, here is the correct measure. Pay attention to your data.

 

Quality Sales = 
CALCULATE (
    [Total Sales],
    KEEPFILTERS (
        'Quality Data'[Status] in { "Issued Paid", "Issued Paid|ARF", "Issued Paid|PDR", "Issued Paid|NY PIF", "Issued Paid|PDR|NY PIF" }
    )
)

 

and here is the output

 

parry2k_0-1664466581140.png

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.

 

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


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.

Ashish_Mathur
Super User
Super User

Hi,

Does this measure work

Quality Sales2 = CALCULATE(SUM('Fact Agency Data'[Original Sales]),'Fact Agency Data'[Status] = "Issue Paid"||'Fact Agency Data'[Status] = "Issue Paid|ARF"||'Fact Agency Data'[Status] = "Issue Paid|PDR"||'Fact Agency Data'[Status] = "Issue Paid|NY PIF")

If it does not, then share the download link of your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

I tired both the options as suggested and neither is returning the results as expected.

Quality Sample 

I think I have a copy of the file with the data and measures linked above for your review.  I certainly do appreciate your assistance.  

 

Wrong spelling - use "issued" instead of "issue".  Try this measure

 

Quality Sales2 = CALCULATE([Total Sales],'Quality Data'[Status] = "Issued Paid"||'Quality Data'[Status] = "Issued Paid|ARF"||'Quality Data'[Status] = "Issued Paid|PDR"||'Quality Data'[Status]= "Issued Paid|NY PIF")

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
parry2k
Super User
Super User

@kg4u you need to update a measure like this, I would not go with the path suggested by @Daryl-Lynch-Bzy 

 

Quality Sales = CALCULATE(

[Total Sales],
KEEPFILTERS(
'Fact Agency Data'[Status] in {"Issue Paid", "Issue Paid|ARF", "Issue Paid|PDR", "Issued Paid|NY PIF", "Issued Paid|PDR|NY PIF" }
)
)

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


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.

Daryl-Lynch-Bzy
Resident Rockstar
Resident Rockstar

Hi @kg4u 

Try the following as the syntax "||" works as the OR operator.

Quality Sales2 =
CALCULATE (
    SUM ( 'Fact Agency Data'[Original Sales] ),
    FILTER (
        'Fact Agency Data',
        'Fact Agency Data'[Status] = "Issue Paid"
            || 'Fact Agency Data'[Status] = "Issue Paid|ARF"
            || 'Fact Agency Data'[Status] = "Issue Paid|PDR"
            || 'Fact Agency Data'[Status] = "Issue Paid|NY PIF"
    )
)

 

I tried with the pipes, and I'm not getting a result in the data table.  The Quality Sales Number should be $15,547,136.23

kg4u_1-1664398208714.png

Attached is a snippet of the dataset I'm working with. The Quality number for this snippet should be $9,183.35.

Original SalesStatus
$748.00Issued Paid
$62.70Issued Paid
$1,485.00Issued Paid
$1,731.95Issued Paid
$791.45Issued Paid
$1,826.00Issued Paid
$2,538.25Issued Paid

 

 

 

parry2k
Super User
Super User

@kg4u your measure below should work, how are visualizaing the data which is making you think it is not working as expected:

 

Quality Sales = CALCULATE(

[Total Sales],

'Fact Agency Data'[Status] in {"Issue Paid", "Issue Paid|ARF", "Issue Paid|PDR", "Issued Paid|NY PIF", "Issued Paid|PDR|NY PIF" }

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


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.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors