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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

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
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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