Forum Discussion
msuser48
3 years agoHelper I
Count rows dynamically and aggregate
This post almost explains perfectly what I want: https://community.powerbi.com/t5/Desktop/Dynamic-Count-of-Rows/m-p/662950 The code proposed by parry2k in the post also works: Count of Products ...
- 3 years ago
Hi, msuser48 ;
Try it.
Count of Products = VAR __currentProduct = SELECTEDVALUE( Table3[Product] ) RETURN IF(HASONEVALUE(Table3[Product]), CALCULATE( COUNTROWS( Table3 ), ALLSELECTED( Table3 ), Table3[Product] <= __currentProduct ),COUNTROWS('Table3'))The final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-yalanwu-msft
3 years agoCommunity Support
Hi, msuser48 ;
Try it.
Count of Products =
VAR __currentProduct = SELECTEDVALUE( Table3[Product] )
RETURN
IF(HASONEVALUE(Table3[Product]),
CALCULATE(
COUNTROWS( Table3 ),
ALLSELECTED( Table3 ),
Table3[Product] <= __currentProduct
),COUNTROWS('Table3'))
The final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.