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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
iW1DOV
Frequent Visitor

How to filter for all or single value?

This is my requirement: I have a sales volumes table; there is a row for each sale a store made, for each day of the year. 
Each row is marked with a flag Comparable - 1 means "Comparable", 0 means "Not Comparable". 
The user wants the ability to see all data or Comparable data only. 

I can put a slicer that filters against the "Comparable " dimension, but it will show "Comparable" and "Not Comparable" choices; I can activate the "Select all" option. Unfortunately the user does not want the ability to filter for "Not Comparable" data only, because - being not comparable - by definition that data alone is meaningless.  He only wants the ability to see all data (comparable and not comparable altoghether) or Comparable ones only.  Something like this: 

iW1DOV_0-1729766137638.png

 

Anyone has a suggestion on how to achieve this? I attach some sample data 

Note that in the sample report the "ALL" choice fiters for non comparable data, which is *NOT* the desired behaviour. 

Thanks in advance, 
Gianfranco 

EDIT: Sorry, I can't figure out how to attach the sample PBIX file, someone can teach me? Thank you

 

 

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@iW1DOV,

 

One approach is to use a field parameter. First create the two measures below, and then create a field parameter using these measures.

 

All = SUM ( Sales[Amount] )
Comparable only = CALCULATE ( [All], Sales[Comparable] = 1 )

 

Field parameter (created via the user interface as explained in the article below):

 

Parameter = {
    ("All", NAMEOF('Measure'[All]), 0),
    ("Comparable only", NAMEOF('Measure'[Comparable only]), 1)
}

 

Use 'Parameter'[Parameter] in a visual:

 

DataInsights_0-1729774087837.png

 

-----

 

DataInsights_1-1729774110021.png

 

https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters 





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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
iW1DOV
Frequent Visitor

IT WORKS! Thank you very much! 

DataInsights
Super User
Super User

@iW1DOV,

 

One approach is to use a field parameter. First create the two measures below, and then create a field parameter using these measures.

 

All = SUM ( Sales[Amount] )
Comparable only = CALCULATE ( [All], Sales[Comparable] = 1 )

 

Field parameter (created via the user interface as explained in the article below):

 

Parameter = {
    ("All", NAMEOF('Measure'[All]), 0),
    ("Comparable only", NAMEOF('Measure'[Comparable only]), 1)
}

 

Use 'Parameter'[Parameter] in a visual:

 

DataInsights_0-1729774087837.png

 

-----

 

DataInsights_1-1729774110021.png

 

https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters 





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

Proud to be a Super User!




Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.