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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
itsmebvk
Continued Contributor
Continued Contributor

Dates between function not working in Evaluate function?

Hi Geeks,

 

I am facing syntax issue. When I am trying to use Datesbetween function in Dax while using Evaluate. I am using Azure Analysis Service as source and using import mode.

 

8C8D0174-2B89-4C47-AE00-F017033AB873.png

 

evaluate(filter('Date_Dim', [Calendar_dt]=DATEVALUE("2021-01-01")))

 

can someone please suggest correct syntax to use Datesbetween function in Evaluate.

 

Thank you.

 

 

1 ACCEPTED SOLUTION

@itsmebvk , I think, with import mode it should work

 

something like

calculateTable(table, DATESBETWEEN(table[Data], date(2019,09,01), date(2020,02,29)))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@itsmebvk , DATESBETWEEN return table , so this should work

evaluate(

DATESBETWEEN(DAte[Data], date(2019,09,01), date(2020,02,29))

)

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
itsmebvk
Continued Contributor
Continued Contributor

@amitchandak  Thanks for quick reply. I want to get all table columns but it should filter table only for between few dates. Is this expression works to achieve this requirement within evaluate function?

 

Can I also use Direct query mode while using Azure Analysis Service model as source?

 

Regards

BVK 

@itsmebvk , I think, with import mode it should work

 

something like

calculateTable(table, DATESBETWEEN(table[Data], date(2019,09,01), date(2020,02,29)))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
itsmebvk
Continued Contributor
Continued Contributor

@amitchandak  Thank you.

 

As suggested by you, I have used following expression and it worked like charm.

 

evaluate(calculateTable('Fact_Table',DATESBETWEEN('Fact_Table'[Calendar_dt],DATEVALUE("2021-01-01"),DATEVALUE("2021-01-03"))))

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.