cancel
Showing results for 
Search instead for 
Did you mean: 
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
Microsoft
Microsoft

@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


View solution in original post

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors