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
Lennart_IV
New Member

How to build a comparison table who shows the difference between newest data and old data?

Hello Guys,

 

I have the following task: I should make a table, who shows the diff between our newest "forecast data" and the old one, like "100.000 profit growth" etc. The Problem is, I found a lot of videos on youtube which show how to build this with fix periods, like comparison by day, week, month or year, but NOT by irregular periods. Just to make sure: every time, we ubload our new data we ubload ALL Data with the current freeze date in the column. That means, that Power Bi has to compare all data with the current freeze date with the data from the last freeze date OR a freeze data of my choice ( would be good If I can decide this with a slicer).

 

I hope you can help me or give me a hint.

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @Lennart_IV ,

 

You could create two independent date slicer tables.

Then calculated the [profit] based on different slicers.

For example:

forecast_new =
CALCULATE (
    SUM ( 'table'[profit] ),
    FILTER (
        ALLSELECTED ( 'table' ),
        'table'[date] >= MIN ( 'slicer1'[date] )
            && 'table'[date] <= MAX ( 'slicer1'[date] )
    )
)
forecast_old =
CALCULATE (
    SUM ( 'table'[profit] ),
    FILTER (
        ALLSELECTED ( 'table' ),
        'table'[date] >= MIN ( 'slicer2'[date] )
            && 'table'[date] <= MAX ( 'slicer2'[date] )
    )
)

At last, create a measure like below to show the difference.

diff =
( [forecast_new] - [forecast_old] ) & " profit growth"

If I misunderstood your meaning, please show some sample data and expected result.

 

Best Regards,

Jay

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

View solution in original post

1 REPLY 1
v-jayw-msft
Community Support
Community Support

Hi @Lennart_IV ,

 

You could create two independent date slicer tables.

Then calculated the [profit] based on different slicers.

For example:

forecast_new =
CALCULATE (
    SUM ( 'table'[profit] ),
    FILTER (
        ALLSELECTED ( 'table' ),
        'table'[date] >= MIN ( 'slicer1'[date] )
            && 'table'[date] <= MAX ( 'slicer1'[date] )
    )
)
forecast_old =
CALCULATE (
    SUM ( 'table'[profit] ),
    FILTER (
        ALLSELECTED ( 'table' ),
        'table'[date] >= MIN ( 'slicer2'[date] )
            && 'table'[date] <= MAX ( 'slicer2'[date] )
    )
)

At last, create a measure like below to show the difference.

diff =
( [forecast_new] - [forecast_old] ) & " profit growth"

If I misunderstood your meaning, please show some sample data and expected result.

 

Best Regards,

Jay

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

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.