cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
eorizondo New Member
New Member

Calculating difference between totals from dates not in sequence

Hello,

 

I am trying to show the difference between two totals on two different days. However, my dates are not in sequence (sometimes 7 days apart, sometimes 6 days apart, etc.). I have created an index number thing ing I could create a measure to just sum my current measure for "Index Number" -1, but that does not seem to work.

 

Ultimately, I want to be able to show the totals for both dates and the difference between them so I can plot the grow / decline in totals.

 

Many thanks

 

 Capture.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Calculating difference between totals from dates not in sequence

@eorizondo,

 

You may refer to the measure below.

Measure 2 =
VAR i =
    MAX ( Table1[Index] )
RETURN
    CALCULATE (
        [Measure],
        FILTER ( ALLSELECTED ( Table1 ), Table1[Index] = i - 1 )
    )
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 REPLIES 3
Super User
Super User

Re: Calculating difference between totals from dates not in sequence

Sample data in text form would help. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

That being said, I think maybe EARLIER? See my article on Mean Time Before Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/3395...


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Community Support Team
Community Support Team

Re: Calculating difference between totals from dates not in sequence

@eorizondo,

 

You may refer to the measure below.

Measure 2 =
VAR i =
    MAX ( Table1[Index] )
RETURN
    CALCULATE (
        [Measure],
        FILTER ( ALLSELECTED ( Table1 ), Table1[Index] = i - 1 )
    )
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Super User
Super User

Re: Calculating difference between totals from dates not in sequence

Hi,

 

Share the link from where i can download your PBI file.

Helpful resources

Announcements
Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Power BI Helps Homeless and Trouble Youth

Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 273 members 2,896 guests
Please welcome our newest community members: