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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Why does paralelperiod generates a WHERE IN for the different dates

Good morning!

 

Hi I was trying to see what SQL queries does my Power BI report generate for the DB, and in my case i was trying a paralelperiod function to see how it is generated in the DB. I´m using a Direct Query connection to my DB in Vertica. This is the example DAX query:

RaulTorres_0-1626941031994.png

When I evaluate the query in DAX Studio I get that the selection of DATES for the query is done one by one with an IN. The column D_DT is Date Time format and when I see the SQL query in DAX studio the result is this: 

RaulTorres_1-1626941213920.png

If you look the scrollbar you realize there is a huge amount of Dates written one by one.

 

So my doubt is , isn´t this very inefficient? Wouldn´t it be better just to use a BETWEEN or any other way more efficient rather than generate all the DATES that is going to use one by one?

 

Thanks for your time!

1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@Anonymous 

You may use DATESINPERIOD(). 

DATESINPERIOD function (DAX) - DAX | Microsoft Docs

 

 

Paul Zheng

View solution in original post

6 REPLIES 6
lbendlin
Super User
Super User
V-pazhen-msft
Community Support
Community Support

@Anonymous 

You may use DATESINPERIOD(). 

DATESINPERIOD function (DAX) - DAX | Microsoft Docs

 

 

Paul Zheng

Anonymous
Not applicable

Thanks, that is what i was looking for!

Anonymous
Not applicable

I have just tried it and it works in the same way. I´m not searching for a practical solution though, I´m just trying to know why it works the way it does and not other way that for me would look more efficient. But thank you anyways for the response.

lbendlin
Super User
Super User

I would agree but the developers probably have a good reason for not using BETWEEN.  Do you know what the compatibility level is for BETWEEN ?

Anonymous
Not applicable

Not really ,I was just asking myself why this was the way parallelperiod worked existing the other ways. But I also agree with you, the developers may have a reason for it

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors