Count rows in matrix

Hello @JamesQi,

I was thinking about how to make no use of calculated columns and convert them into the measures and then I realized that Sam Sir has already created a video on this topic and it almost went off my mind.

So rather then following the first two steps I converted them into one single step i.e. a measure and then created one final measure to fix the totals which was my third step. Below is the measure provided for the reference -

Completed PO's - 2 = 
VAR _Current_PO = SELECTEDVALUE( Sheet1[PO ID] )

VAR _Occurence_of_PO =
COUNTX(
    FILTER( ALL( Sheet1 ), Sheet1[PO ID] = _Current_PO ),
        Sheet1[PO ID] )

VAR _Condition = 
SELECTEDVALUE( Sheet1[SKU QTY] ) = SELECTEDVALUE( Sheet1[Unfinished QTY] )

RETURN
SWITCH( TRUE() , 
    _Occurence_of_PO > 1 , 0 , 
    _Condition , 0 , 
    1 )

I’m also attaching the updated version of the working PBIX file as well as the providing the link of the video below which I remembered/referred to convert my calculated column into the measure. Also providing the link of a post which our expert @Greg had created about how to fix the totals. (I forgot to provide the link of that post in my previous post.)

Hoping you find this useful and meets your requirements that you’ve been looking for. :slightly_smiling_face:

Thanks and Warm Regards,
Harsh

Completed PO - Harsh v2.pbix (22.6 KB)

1 Like