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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Vamshi2020
Helper II
Helper II

Calender view slicer issue

Hey guys,

i need to write a measure to 
Calculate no of rows of a table after last refresh date(which is done), but on the same line i have a calender slicer, if user selects any date range, it should count rows from end date value.

 

Total Booked=var a= maxx(Calender[Date)
var b=CALCULATE(COUNTROWS('Data_Arrivals with Case Priorit'),FILTER('Data_Arrivals with Case Priorit','Data_Arrivals with Case Priorit'[Arrival Date]>=a))
return
IF(b=BLANK(),0,b)
 
My calender date script is CALENDAR(date(2020,10,01),today() as my client wants to last refresh date as end value in slicer by default.
 
My Total booked measure is not working properly and it always gives data for last refresh date only even though if i make any dat selection in slicer
 
Let me know your suggestions pls
2 REPLIES 2
v-lionel-msft
Community Support
Community Support

Hi @Vamshi2020 ,

 

Or try this formula.

 

Total Booked = 
var a= maxx( ALLSELECTED(Calender), Calender[Date)
var b=
CALCULATE(
    COUNTROWS('Data_Arrivals with Case Priorit'),
    FILTER(
        'Data_Arrivals with Case Priorit',
        'Data_Arrivals with Case Priorit'[Arrival Date]>= a
    )
)
return
IF(
    b=BLANK(),
    0,b
)

 

 

Best regards,
Lionel Chen

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

AllisonKennedy
Super User
Super User

I don't fully understand what you're trying to do - can you share screenshots or sample file?

The syntax for your DAX has some errors - what table are you using for VAR a?

For the calendar 'script' are you saying that you have created your Calendar/DimDate table in DAX using the Calendar function? Or do you have two calendar tables - one for the slicer and one for other? What relationships are there between these tables?

PS, I recommend creating the calendar table using M code, not DAX, if possible. It can still update to today's date (as of last refresh). https://excelwithallison.blogspot.com/2020/04/dimdate-what-why-and-how.html

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors