Forum Discussion
utsurur
2 years agoNew Member
[Need Help] How to Sum Values in subtotal based on Column/Row with CountDistinct formula
Please help my problem, I calculate measure column distinct count of device_id with a formula: #_D Mobile + Wifi = CALCULATE(
DISTINCTCOUNT(f_mw_202301_202404[device_id]),
FILTER(...
- 2 years ago
Hi utsurur ,
You can try this measure.
#_D Mobile + Wifi = SUMX ( CROSSJOIN ( VALUES ( 'Table'[Matrix Row Field] ), VALUES ( 'Table'[Matrix Column Field] ) ), CALCULATE ( CALCULATE ( DISTINCTCOUNT ( f_mw_202301_202404[device_id] ), FILTER ( f_mw_202301_202404, f_mw_202301_202404[category] = "Buy" || f_mw_202301_202404[category] = "Use" ) ) ) )Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !
Thank you~
xifeng_L
Super User
2 years agoHi utsurur ,
You can try this measure.
#_D Mobile + Wifi =
SUMX (
CROSSJOIN (
VALUES ( 'Table'[Matrix Row Field] ),
VALUES ( 'Table'[Matrix Column Field] )
),
CALCULATE (
CALCULATE (
DISTINCTCOUNT ( f_mw_202301_202404[device_id] ),
FILTER (
f_mw_202301_202404,
f_mw_202301_202404[category] = "Buy"
|| f_mw_202301_202404[category] = "Use"
)
)
)
)
Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !
Thank you~