Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

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:

 

Trial.PNG

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...

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

 

1 ACCEPTED SOLUTION

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

Try Like

measure =
var _min = minx(Date,Date[Date])
var _max = maxx(Date,Date[Date])
return
if(max(table[Delivery_date])>=_min &&  max(table[Delivery_date])<=_max,"Yes","No")

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Ashish_Mathur
Super User
Super User

Hi,

Share some dummy data in a PBI file and show the expected result there.

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

@Ashish_Mathur Im not sure how to share the pbix file here, but Ive put up a pbix file with its pbix file on my Google Drive.

 

https://drive.google.com/open?id=1FVBVSF99OlrmDvPeUFxOBmReF4SQM_Hu

 

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.