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

Creating a Measure based on set criteria

Hi All,

 

I have just discover PowerBI and have already got a lot out of it for little effort, however I have now hit a stumbling block.

 

I am trying to calculate ATV using our total sales column and total transactions but for some unknown reason we calculate our ATV by filtering out specific categories (such as free gifts, really low RRP items and other none "core" items). However we still account for every transaction (including the lower end RRP items etc)

 

So what I need to do is create a measure for total sales that only calculates the total value of one column, using the criteira of another column which lists the product category. So for example:

 

Sales    Category

20        Bracelet

2.99     Merchandising        

30        Rings

 

So from this, I only need the measure to add Rings and Bracelets whilst ignoring merchandising. Its probably dead simple but my trusty SUMIF doesnt work in DAX!

 

Thanks in advance.

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

MyMeasure = CALCULATE(SUM(Table[Sales]),Table[Category]="Bracelet" || Table[Category]="Rings")

@ me in replies or I'll lose your thread!!!
Check out my External Tool for Power BI Desktop!
Microsoft Hates Greg's Quick Measures
Check out my latest book!

View solution in original post

1 REPLY 1
Greg_Deckler
Super User
Super User

MyMeasure = CALCULATE(SUM(Table[Sales]),Table[Category]="Bracelet" || Table[Category]="Rings")

@ me in replies or I'll lose your thread!!!
Check out my External Tool for Power BI Desktop!
Microsoft Hates Greg's Quick Measures
Check out my latest book!

View solution in original post

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!