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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Return records by slicer selection

Hello All,

I have a table in my power bi desktop that has blank values in my id column(see below).I have a name slicer in my report. Now what i want is to return all the records have the same id as that of the name selected in slicer along with records that have blank id. I have been able to return the records with same id but am unable to return blank id one as well. 

Please see below.

Thanks in advance.myfile.png

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

To create a calcualted table.

 

Filter = VALUES(Table1[name])

Then we can create a measure as below and make the table visual filtered by the measure.

 

Measure = var selename = SELECTEDVALUE('Filter'[name])
var sameid = 
CALCULATE(MAX(Table1[id]),FILTER(ALL(Table1),Table1[name]=selename))
return
IF(MAX(Table1[id]) = BLANK() || MAX(Table1[id])=sameid,1,0)

2.PNG

 

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

6 REPLIES 6
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

One sample for your reference.

 

1. Create a calcualted table.

 

Filter = VALUES(Table1[id])

2. Create a measure and make the table visual filtered by the measure as below.

 

Measure = var _id = MAX(Table1[id])
var _sele = SELECTEDVALUE('Filter'[id])
return
IF(ISBLANK(_id) || _sele=_id,1,0)

Capture.PNG

 

Please find the pbix as attached.

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

Thankyou  @v-frfei-msft  for the solution very much but I am filtering by Name column in my slicer . So what would i write in my measure in that case.

Hi @Anonymous ,

 

To create a calcualted table.

 

Filter = VALUES(Table1[name])

Then we can create a measure as below and make the table visual filtered by the measure.

 

Measure = var selename = SELECTEDVALUE('Filter'[name])
var sameid = 
CALCULATE(MAX(Table1[id]),FILTER(ALL(Table1),Table1[name]=selename))
return
IF(MAX(Table1[id]) = BLANK() || MAX(Table1[id])=sameid,1,0)

2.PNG

 

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

Thanks Again @v-frfei-msft for your solution. I tried doing this query by creating a measure 

id_selected = SelectedValue(table3[id], 0)

Then created an id table with unique values minus the blank one  and  a calculated table where

Calculated Table = filter(All(table3),table3[id] = id_selected || table3[id] = blank())

but I didnt get the desired result. I cant figure out why.

Also i created relationship between them and used bifilter mode.

Can you tell me why.

 

Also can you tell me how max function in working in your measure.

 

Regards,

Chahat

Hi @Anonymous ,

 

Actually the data in calculated column / table will not be changed dynamiclly by the selected value in slicer. So here I create a table visual to work on it, not a calcualted table. 

 

Here the I get the id of current row by MAX function. 

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

Hi @v-frfei-msft  your solution is working fine but isnt there any other way of doing this since i want that when i dont select any name in my Name slicer, my complete table should be displayed as it is rather than showing only the blank id records only.

Also I am doing the filtering in two tables.

 

Regards 

Chahat

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors