Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi All,
I have two Fact Tables Table A and Table B. I want to get distinct count metric from Column which is comoon from both tables. Currenlty, I'm using below code and it's taking Time. Please Suggest optimized way for calculating it
Example:
FactA[Column] & FactB[Column]:
Thanks,
Abhiram
Solved! Go to Solution.
@abhiram342 - Be easier to verify if had sample data or data set but maybe try:
DistinctCount =
COUNTROWS(
DISTINCT(
UNION(
SELECTCOLUMNS('FactA',"Column",[Column]),
SELECTCOLUMNS('FactB',"Column",[Column])
)
)
)
@abhiram342 , Try like
countx(distinct(union(all('FactA'[Column]),all('FactB'[Column]))),[Column])
or
countrows(distinct(union(all('FactA'[Column]),all('FactB'[Column]))))
[Distinct Count] =
COUNTROWS(
DISTINCT(
UNION(
VALUES( FactA[Column] ),
VALUES( FactB[Column] )
)
)
)
[Distinct Count] =
COUNTROWS(
DISTINCT(
UNION(
VALUES( FactA[Column] ),
VALUES( FactB[Column] )
)
)
)
@abhiram342 , Try like
countx(distinct(union(all('FactA'[Column]),all('FactB'[Column]))),[Column])
or
countrows(distinct(union(all('FactA'[Column]),all('FactB'[Column]))))
@abhiram342 - Be easier to verify if had sample data or data set but maybe try:
DistinctCount =
COUNTROWS(
DISTINCT(
UNION(
SELECTCOLUMNS('FactA',"Column",[Column]),
SELECTCOLUMNS('FactB',"Column",[Column])
)
)
)
User | Count |
---|---|
47 | |
28 | |
23 | |
18 | |
15 |
User | Count |
---|---|
55 | |
34 | |
18 | |
17 | |
15 |