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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

How to get count of rows

I have a column with dates like 02/04/2019,02/5/2019,.....02/28/2019.

Data.PNG

That column values should compare with today date(02/05/2019) and get the count of rows . for today i need to get the count as 2. tomorrow the count is 3.

if(date<=today()) the count is 2

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous

 

Measure =
COUNTROWS ( FILTER ( Table1, [Execution date] <= TODAY () ) )

Regards
Zubair

Please try my custom visuals

View solution in original post

2 REPLIES 2
moumipanja
Employee
Employee

@Anonymous

 

I created 2 measures, first one counts the rows starting today's date, second one returns the count as 2 for today and all past dates and then 3 for tomorrow, 4 for day after tomorrow and so on.

 

Measure1

 

Countrows = CALCULATE(COUNTROWS(Table1), 
FILTER(ALLSELECTED(Table1),
Table1[Execution date]>=TODAY() &&
Table1[Execution date]<=MAX(Table1[Execution date])))
Display the below measure to get your result
 
Count = IF([Countrows]<2,2,[Countrows]+1)
1.JPG
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous

 

Measure =
COUNTROWS ( FILTER ( Table1, [Execution date] <= TODAY () ) )

Regards
Zubair

Please try my custom visuals

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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