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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
canvasscompany
Regular Visitor

Compare previous and new sales in DirectQuery mode

Hi All,

 

I want to compare the sales result of the current month to the previous month. I found 3 simple DAX formula's.

All of them don't work in "DirectQuery mode". Function is not supported...

 

Prev. Month Sales = CALCULATE(SUM([Total Sales]),DATEADD([Date]),-1,MONTH))

Prev. Month Sales = CALCULATE(SUM([Total Sales]),PREVIOUSMONTH([Date])) 

Prev. Month Sales = CALCULATE(SUM([Total Sales]),PARALLELPERIOD([Date],-1,MONTH))

 

 

Is there a way to make this calculation in DirectQuery mode? Hope you can help me out with this one!

3 REPLIES 3
v-yulgu-msft
Employee
Employee

Hi, @canvasscompany

 

To make DATEADD, PREVIOUSMONTH and PARALLELPERIOD function available in Directory Query mode, please

go to file -> options and settings -> options -> direct query ->"Allow unrestricted measures under direct query" .

 

Best regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi,

 

I realize this is an old one, but I just tried it having "Allow unrestricted measures under direct query" selected and it didn't work for me.

 

Am I missing something?

 

Thanks

CheenuSing
Community Champion
Community Champion

@canvasscompany

 

Check out the link

https://www.powerquery.training/portfolio/time-intelligence-with-power-query/

 

see if it helps.

 

Cheers

 

CheenuSing

 

 

Did I answer your question? Mark my post as a solution and also give KUDOS !

Proud to be a Datanaut!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.