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

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

Reply
YukiK
Impactful Individual
Impactful Individual

How to get a list of values from a column in DAX?

I'd like to get a list of values of a column in a table so that I can do a condition where " if (_myDepartment in _valuesOfColumn, do A, else B)". I'll use the boolean value from that variable in another variable.

 

I can use Values function, but I need to ignore the context filter so the list has the full list of values.

 

In short:

I currently have a variable where

VAR _listOfdistinctPrevUnits = { "E3", "L4", "F3", "B2", "B3", "L6" }
 
 

This essentially the values from a column of a table. I guess I wanna get these values dynamically.

 

I can't seem to find an answer for this, but any idea for how to accomplish this?

2 ACCEPTED SOLUTIONS
AlexisOlson
Super User
Super User

The VALUES function does this. Consider other similar functions too depending on your exact requirements: DISTINCT, ALL, ALLSELECTED).

 

View solution in original post

Anonymous
Not applicable

HI @YukiK,

You can try to use the following measure formula to compare selection and list of values to return tag:

Measure =
IF (
    COUNTROWS ( INTERSECT ( VALUES ( Table[Column] ), ALL ( Tableb[Column] ) ) ) > 0,
    "A",
    "B"
)

Regards,

Xiaoxin Sheng

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

HI @YukiK,

You can try to use the following measure formula to compare selection and list of values to return tag:

Measure =
IF (
    COUNTROWS ( INTERSECT ( VALUES ( Table[Column] ), ALL ( Tableb[Column] ) ) ) > 0,
    "A",
    "B"
)

Regards,

Xiaoxin Sheng

AlexisOlson
Super User
Super User

The VALUES function does this. Consider other similar functions too depending on your exact requirements: DISTINCT, ALL, ALLSELECTED).

 

amitchandak
Super User
Super User

@YukiK , assume you want to use in a filter

 

filter(Table, _myDepartment in values(Table[Column]))

 

or

 

filter(Table, _myDepartment in allselected(Table[Column]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Kudoed Authors