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
Jhaynie
New Member

Filter Table Results to include certain values

Hello,

 

I have a Table listing results of promotional activity with each line showing an event, Total Sales, Total Promo Volume, etc which are input as measures.  I have another column in my dataset called "Include" with Yes/No values.

 

Dataset name: promo dbase

Measure Name "Total Sales"

 

I am trying to filter my table to show all results visually but only include values corresponding to a "Yes" value in the totals.  Here is where I am stuck:  Total Sales  = CALCULATE(SUM('promo dbase'[Total Sales]),FILTER('promo dbase',(SEARCH("Yes",[Include]))))

 

Any help would be greatly appreciated!

1 ACCEPTED SOLUTION
mahoneypat
Employee
Employee

Have you tried this simpler expression?

 

Total Sales  = CALCULATE(SUM('promo dbase'[Total Sales]), 'promo dbase'[Include]="Yes")

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
mahoneypat
Employee
Employee

Have you tried this simpler expression?

 

Total Sales  = CALCULATE(SUM('promo dbase'[Total Sales]), 'promo dbase'[Include]="Yes")

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Thank you!  I modified it to show the values in the table even when they are not counted by wrapping it in an "IF" statement:  

Total Sales Chart = IF(CALCULATE(SUM('promo dbase'[Total Sales]), 'promo dbase'[Include]=1)>0,CALCULATE(SUM('promo dbase'[Total Sales]), 'promo dbase'[Include]=1),[Total Sales])
 
I changed "Yes" and "No" values to "1" and "2"

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.

Top Solution Authors