Forum Discussion

rdg515's avatar
rdg515
Icon for Resolver I rankResolver I
5 years ago
Solved

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]
    )
)

 

 

 

  • 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



1 Reply

  • 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