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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Vamshi2020
Helper II
Helper II

Count rows except the selected date range

Hi guys,

 

I have Table A which has Arrival Date, Affliate columns and calender table which i use for Slicer. Iam using Between view of slicer.

My requirement is to get the count of Affliates after end range of slicer. For ex:

if i select 1st Oct to 19th oct in slicer , it should give me the count of rows after 19th oct .

 

I tried with below measure , unfortunately it's not working.

var a=MAXX(Calender,Calender[Date])
var b=CALCULATE(COUNTROWS('Data_Arrivals with Case Priorit'),'Data_Arrivals with Case Priorit'[Arrival Date]>=a)
return b
 
The measure just gives the value for default view, but not for slicer selection.

Please helpme on this.
 
TIA

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Vamshi2020 ,

 

You may try this measure. There is no relationship between the calendar table and the main table.

5.png

CountRows =
CALCULATE (
    COUNTROWS ( 'Table' ),
    FILTER ( 'Table', NOT ( [Arrival Date] IN ALLSELECTED ( 'Calendar'[Date] ) ) )
)

4.png

 

You can check more details from here.

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Vamshi2020 ,

Could you tell me if your problem has been solved?
If it is, kindly Accept it as the solution. More people will benefit from it.
Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.


Best Regards,
Stephen Tao

Anonymous
Not applicable

Hi @Vamshi2020 ,

 

You may try this measure. There is no relationship between the calendar table and the main table.

5.png

CountRows =
CALCULATE (
    COUNTROWS ( 'Table' ),
    FILTER ( 'Table', NOT ( [Arrival Date] IN ALLSELECTED ( 'Calendar'[Date] ) ) )
)

4.png

 

You can check more details from here.

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Ashish_Mathur
Super User
Super User

Hi,

Try this measure

=calculate(COUNTROWS('Data_Arrivals with Case Priorit'),datesbetween(calendar[date],max(calendar[date])+1,maxx(all(calendar),calendar[date])))

Hope this helps.


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

I haven't read too carefully, so I may be off mark here, but try:

var a=MAXX(ALLSELECTED(Calender),Calender[Date])

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors