Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

How to count rows (with conditions) in a table visual?

Hello everyone,

 

I have an Excel list from SAP system that contains purchased items with their PO Date and their estimated delivered date.

I'm trying to do some simple reporting which I will have a date slicer, and whenever a user specifies the start date and end date; the report will show (1) all purchased items in period from slicer (via PO date) and also (2) purchased items with estimated delivered date in period from slicer.

 

I've seem to be able to achieve it in the table visual below:

 

The "PO Date" and "Delivery date" are original columns from data source. "Start Date from Slicer", "End Date from Slicer" and "Delivery date between Slicer Dates" are all using Measures.

 

What I want to do now is to count how many rows are "Yes" in "Delivery date between Slicer Dates". I've tried using this measure but it returns Blank

 

Count of Yes =
COUNTROWS (
    FILTER (
        SUMMARIZE (
            SAP DATA,
            SAP DATA[PO Date],
            "Yes", [Delivery date between slicer dates]
        ),
        [Delivery date between slicer dates] = "Yes"
    )
)

Any recommendation?

 

By the way sorry if this is repeating. I've already tried referring here but to no avail:

 https://community.powerbi.com/t5/Desktop/How-to-count-rows-of-a-measure-in-a-table-visual/m-p/283648#M126104

https://community.powerbi.com/t5/Desktop/Table-visual-rows-count/td-p/448336

 

4 Replies