Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi,
I have data for two columns,
However I would like to have the unique values from both the columns.
Ex- Country 1 and Country 2 details are as follows-
Country 1 |
Ghana |
Netherlands |
Canada |
France |
Germany |
Hungary |
Poland |
Romania |
United States |
Switzerland |
Portugal |
Germany |
Spain |
Russian Federation |
Vietnam |
Singapore |
Spain |
Italy |
Ukraine |
Netherlands |
United States |
Poland |
Uruguay |
Malaysia |
South Africa |
India |
Australia |
Singapore |
Brazil |
Turkey |
Argentina |
Paraguay |
United Kingdom |
Mexico |
Country 2 |
Netherlands |
United States |
Malaysia |
Ghana |
Canada |
Switzerland |
Spain |
Uruguay |
Portugal |
Poland |
Germany |
Hungary |
France |
China |
Singapore |
Mexico |
United States |
Singapore |
Italy |
Canada |
South Africa |
Ukraine |
Russian Federation |
Finland |
Switzerland |
Romania |
Bermuda |
Brazil |
Egypt |
Turkey |
India |
Argentina |
Netherlands |
United Kingdom |
France |
Germany |
Italy |
Spain |
Malaysia |
China |
Poland |
Finland |
Hungary |
Austria |
Portugal |
Russian Federation |
Vietnam |
Ukraine |
Can I get unique data from both the columns combined in Power BI using any DAX functions?
Hi @Soumik ,
Please try below steps:
1. below is my test table
Table:
2. create a new table with below dax formula
Table 2 =
VAR _a =
FILTER ( VALUES ( 'Table'[Country 1] ), 'Table'[Country 1] <> BLANK () )
VAR _b =
FILTER ( VALUES ( 'Table'[Country 2] ), 'Table'[Country 2] <> BLANK () )
VAR _c =
UNION ( _a, _b )
VAR _d =
DISTINCT ( _c )
RETURN
_d
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, thanks for the code but it is throwing up an error
Hi @Soumik ,
Could you please provide more information? it is very helpful for me to test.
Thanks for your efforts & time in advance.
Best regards,
Community Support Team_Binbin Yu
Create New Table
Countries = Summarize(Union(Values([Country1]),Values([Country2]),[Country1])
Thanks for the code, this is throwing up an error
Could you share the full code?
Use Except function then.
NewTable=
Thanks for the code, however this is throwing up an error
User | Count |
---|---|
13 | |
8 | |
8 | |
7 | |
5 |
User | Count |
---|---|
23 | |
15 | |
15 | |
10 | |
7 |