Forum Discussion
Anonymous
7 years agoNot applicable
Dynamic Count of Rows
Hi PBI Community, I'm wondering whether you could help me with a problem I came across recently. I do have a lengthy DAX measure to correctly calculate a metric at different hierarchy levels and ...
- 7 years ago
Anonymous try this measure, change table and column name as per your data model.
Count of Products = VAR __currentProduct = SELECTEDVALUE( Table3[Product] ) RETURN CALCULATE( COUNTROWS( Table3 ), ALLSELECTED( Table3 ), Table3[Product] = __currentProduct )
parry2k
7 years agoSuper User
Anonymous try this measure, change table and column name as per your data model.
Count of Products =
VAR __currentProduct = SELECTEDVALUE( Table3[Product] )
RETURN
CALCULATE(
COUNTROWS( Table3 ),
ALLSELECTED( Table3 ),
Table3[Product] = __currentProduct
)mc2863
5 years agoRegular Visitor
attempting to use this solution, but the measure returns empty calculations. Is this measure possible with a table as a new measure column? If I hard code the value selection, the countrow works, but using selected value is just blank.