The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello,
My understanding was that Distinct Union would remove duplicate rows, however I keep getting duplicate rows. Was hoping there might be something simple that someone could point out that is incorrect. Thanks for any tips!
In the below example, I'll get the following row twice:
United States, Hardware, $500
DEFINE
VAR Table1=
SUMMARIZECOLUMNS(
'Sales Structure'[SLS LVL 1],
'Product Table'[Product 1],
KEEPFILTERS( TREATAS( {"United States"}, 'Sales Structure'[SLS LVL 1] )),
"Orders Revenue", [Orders Revenue]
)
VAR Table2=
SUMMARIZECOLUMNS(
'Sales Structure'[SLS LVL 1],
'Product Table'[Product 1],
KEEPFILTERS( TREATAS( {"Hardware"}, 'Product Table'[Product 1] )),
"Orders Revenue", [Orders Revenue]
)
VAR UnionTable = Union(Table1,Table2)
VAR Output = Distinct(UnionTable)
Evaluate
Output
User | Count |
---|---|
25 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
31 | |
12 | |
10 | |
10 | |
9 |