cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ugarte335 Helper I
Helper I

Roll back date of measure in PowerBI

Hello!


I hope it's clear what I am trying to achieve. I am basically comparing two different measures to get a market share. For example:

 

Phones sold by company / Phones sold by market

 

However what I would like is to have the same thing but moving back one of the measures, for example three months being:

 

Phones sold by company (six months ago) / Phones sold by market

 

 

Basically I am trying to achieve to move back the date of the first measure by six months. I am trying to use DATEADD as filter like:

 

CALCULATE ( Phones sold by company, DATEADD ( 'Calendar'[Date], -6, MONTH ) ) / Phones sold by market
 
 
So then any calculation I make will have this date rolled back whether I do it by months, years, etc. I believe it's wrong and should not be a filter.
I get an error saying that a function dateadd has been used in a True False expression taht is used as a table filter expression.
 
Thanks!
1 ACCEPTED SOLUTION

Accepted Solutions
Super User IV
Super User IV

Re: Roll back date of measure in PowerBI

Seem fine, Just try with some other measure.

The only doubt neither the agg is used nor field is used as a measure

CALCULATE ( [Phones sold by company], DATEADD( 'Calendar'[Date], -6, MONTH ))
CALCULATE ( [Phones sold by company], datesmtd(DATEADD( 'Calendar'[Date], -6, MONTH )))

 

CALCULATE ( sum(Table[Phones sold by company]), DATEADD( 'Calendar'[Date], -6, MONTH ))
CALCULATE ( sum(Table[Phones sold by company]), datesmtd(DATEADD( 'Calendar'[Date], -6, MONTH )))

 

Check position of (  and )

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin





Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
In case it does not help, please provide additional information and mark me with @
My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP,
HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Super User! Linkedin


View solution in original post

2 REPLIES 2
Super User IV
Super User IV

Re: Roll back date of measure in PowerBI

Seem fine, Just try with some other measure.

The only doubt neither the agg is used nor field is used as a measure

CALCULATE ( [Phones sold by company], DATEADD( 'Calendar'[Date], -6, MONTH ))
CALCULATE ( [Phones sold by company], datesmtd(DATEADD( 'Calendar'[Date], -6, MONTH )))

 

CALCULATE ( sum(Table[Phones sold by company]), DATEADD( 'Calendar'[Date], -6, MONTH ))
CALCULATE ( sum(Table[Phones sold by company]), datesmtd(DATEADD( 'Calendar'[Date], -6, MONTH )))

 

Check position of (  and )

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Connect on Linkedin





Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
In case it does not help, please provide additional information and mark me with @
My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP,
HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Super User! Linkedin


View solution in original post

Highlighted
Ugarte335 Helper I
Helper I

Re: Roll back date of measure in PowerBI

Apologies, I believe there was an error in my formula. Now seems to work correctly

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors