Forum Discussion
JM_nxgn
Helper I
7 years agoDAX DistinctCount with SUMX totals
Hi, I know there are quite a few of these posts but I feel my case is a bit different since it has quite a few moving parts. I've tried various things and I'm still struggling to find a solution, hop...
- 7 years ago
Hi JM_nxgn ,
You can create measure like DAX below.
Sales = var d= CALCULATE(DISTINCTCOUNT(table[customer_id]), table[issold] = TRUE()) VAR _table = SUMMARIZE(table, table[Product_ID],"_Value", d) RETURN IF(HASONEVALUE(table[Product_ID]),d,SUMX(_table,[_Value]))
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-xicai
Community Support
7 years agoHi JM_nxgn ,
You can create measure like DAX below.
Sales = var d= CALCULATE(DISTINCTCOUNT(table[customer_id]), table[issold] = TRUE()) VAR _table = SUMMARIZE(table, table[Product_ID],"_Value", d) RETURN IF(HASONEVALUE(table[Product_ID]),d,SUMX(_table,[_Value]))
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
JM_nxgn
Helper I
7 years agoThis worked for me thanks.