Forum Discussion
DISTINCT command pulls BLANKS
- 9 years ago
Just change the column instead of all table
Table = DISTINCT(FILTER(VALUES(Transactions[CheckInLoc]),LEN(Transactions[CheckInLoc])>0))
Hi, please try with this:
Table = DISTINCT(FILTER(Transactions,LEN(Transactions[CheckInLoc])>0))
Hi,
Nice try and thank you very much for your suggestion.
However...
I only want the CheckinLoc column with the unique values for that column. Your query pulls all columns.
- Vvelarde9 years agoCommunity Champion
Just change the column instead of all table
Table = DISTINCT(FILTER(VALUES(Transactions[CheckInLoc]),LEN(Transactions[CheckInLoc])>0))
- DataGuy20169 years agoAdvocate IV
- Emmaxson9 years agoAdvocate I
Came in handy after may other options did not help me.
- MarkPalmberg7 years agoKudo Commander
Vvelarde , I'm having an issue with this solution. I created my table of (what appear to be) distinct values using the following DAX:
Units = VAR tbl1 = DISTINCT(FILTER(VALUES('Prospect Pool'[Unit]),LEN('Prospect Pool'[Unit]) > 0)) VAR tbl2 = DISTINCT('Qualification Interactions'[BUSINESS UNIT]) RETURN UNION(tbl1,tbl2)But when I try to join that new table to another table in a one-to-many relationship, I get an error that one of the columns must contain distinct values. I took the results from the DAX above into Excel to examine more closely for issues but didn't find any.
Any thoughts on what might be messing me up here? Thanks (if you're still out there!). Perhaps I need to use a different method to generate this table of distinct values from columns in multiple tables?
- Vvelarde7 years agoCommunity Champion
Hi, maybe there are duplicates in the Union.
Also i prefer to filter the blank rows instead of Len > 0
DISTINCT(FILTER(VALUES(Table1[Unit]),Table1[Unit]<>BLANK()))
Regards
Victor