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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
thems5
Regular Visitor

Power BI measure

Hi,
I wish to measure the percentage of the difference between each period to period before.
I am trying to create this report using Power BI for the first time.
When I was using an Excel pivot table, I created this reports by going to "value fields definitions" - "show values as" - "% difference from" - "(the last)".
My question is - I understand that in Power BI I need to write a measure to make this calculation.
Can you help me write this measure(s)?
Please find the attached a screenshot of the file. What I need is to show the table in the file, only with the % of the difference between each year.image.png

 

 
Thanks
Moshe Slonim

 

 

5 REPLIES 5
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi Moshe,

 

Just based on your data here, please try the formula below.

Measure =
VAR thisYearTotal =
    SUM ( 'DB_sample'[Sales] )
VAR lastYearTotal =
    CALCULATE (
        SUM ( 'DB_sample'[Sales] ),
        FILTER (
            ALL ( DB_sample[Year] ),
            DB_sample[Year]
                = MIN ( DB_sample[Year] ) - 1
        )
    )
RETURN
    DIVIDE ( thisYearTotal - lastYearTotal, lastYearTotal, 0 )

Best Regards,

Dale

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

image.png

 

 

Hi @thems5,

 

Can you share your file? Please refer to the snapshot below. Double click the menu "Modeling".

Power_BI_measure

 

Best Regards,

Dale

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

Thank you.

I cannot find the way to attach a file here so I attached it in my email reply.

Regards

Moshe

Thank you very much Dale.

The good news - it works (partially).

The bad news - 

a. it only works for the total, not for all columns.

b. I coul not find where to change the decimal number to a percentage.

I attach a screen shot.

Can you help?

Thanks

 

 

 

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.