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 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 |
---|---|
13 | |
10 | |
8 | |
7 | |
5 |
User | Count |
---|---|
24 | |
16 | |
15 | |
10 | |
7 |