Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
I want to retrieve unique rows from three different columns in three different tables. Then, I want to filter out rows that contain `*` or are blank. The following code provides the desired result:
What could be the reason for the error?
Hi @jzhao ,
The reason for the error in your second code is that you are using the VALUES function instead of the DISTINCT function to return a table of unique rows. The VALUES function returns a one-column table that contains the distinct values from the specified column, optionally ignoring any blank values. However, in your case, you are passing a table expression to the VALUES function, which is not a valid argument. The VALUES function expects a column reference as its input parameter.
The DISTINCT function, on the other hand, returns a table by removing duplicate rows from another table or expression. The DISTINCT function can take any table expression as its input parameter, and it will return a table with the same columns and only distinct rows.
Therefore, to fix your error, you need to replace the VALUES function with the DISTINCT function in your second code, as you did in your first code. This will ensure that you are passing a valid table expression to the FILTER function, and that you are getting a table of unique rows from three different columns in three different tables.
Solved: Find and Replace values either by a measure and or... - Microsoft Fabric Community
DISTINCT (table) function (DAX) - DAX | Microsoft Learn
powerbi - DAX Query to Get Distinct Items from Multiple Tables - Stack Overflow
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Rongtie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @jzhao UNION function features: The two tables must have the same number of columns. In example column1 clean and column2 clean
https://learn.microsoft.com/en-us/dax/union-function-dax?WT.mc_id=DP-MVP-4025372
Did I answer your question? Kudos appreciated / accept solution!
Proud to be a Super User!
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
24 | |
21 | |
17 | |
14 | |
10 |
User | Count |
---|---|
42 | |
35 | |
25 | |
23 | |
23 |