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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Thisaatty
New Member

Filter a table based on a DAX variable value

Hi,

I want to filter a table based on variable value. First I have taken the variable into a measure as shown below

Selected ID = SELECTEDVALUE(study[Studyid_commonname])
 
Then I have added a new column with (1,0) to the table (study_site) that I want to filter. (so I can filter based on 1,0)
 
ID Check = IF([Selected ID]=study_site[Studyid_commonname],1,0)
 
But it gives 1 to all rows. Is there any other way to do this?
3 REPLIES 3
tamerj1
Super User
Super User

Hi @Thisaatty 
Calculated columns do not interact with the filter context. What exactly are you trying to achieve?

Hi @tamerj1 , Thanks for replying

 

I want to filter a visual based on a value that's in a card

@Thisaatty 
Ok, but this requires to provide more details. Is 'study' a disconnected or connected table? What which level/granularity the visual is represented? What table(s) column(s) involved in the visual? Screenshots would greatly help to understand the problem.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.