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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
rdg515
Resolver I
Resolver I

Distinct Values for column A with filter on column B

I'd simply like to get the distinct values for a particular column that is filtered by another column. 

 

Here is my attempt, but I get the following error:
The VALUES function expects a column reference expression or a table reference expression for argument '1'.

 

 

VALUES(
    SELECTCOLUMNS(
        FILTER(Table, 
            Table[B] in{"apples","oranges"}
        ),
        "Distinct Column A Values",Table[A]
    )
)

 

 

 

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@rdg515 


Use the following code to create a new table from the modeling tab > New Table

New Table = 
CALCULATETABLE(
    VALUES(Table[A]),
        Table[B] in {"apples","oranges"}
)

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

1 REPLY 1
Fowmy
Super User
Super User

@rdg515 


Use the following code to create a new table from the modeling tab > New Table

New Table = 
CALCULATETABLE(
    VALUES(Table[A]),
        Table[B] in {"apples","oranges"}
)

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.