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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
MoayadGharaibeh
Regular Visitor

How to calculate "Difference % From Previous date"

Hi Community,

 

I was using Excel Dashboards and want to move it to PowerBi. One feature in (excel Pivot Chart) i was using frequently and can't find it in PowerBI is (Show Values As > % Difference From.. > Base Field: Date/Base Item: (Previous)):

MoayadGharaibeh_0-1652856308204.pngMoayadGharaibeh_1-1652856321633.png

 

I need the data to be shown in the Dashboard as per the following lines (secondary axis):

MoayadGharaibeh_2-1652856456315.png

 

How to do it in PowerBI, knowing that i'm a beginner.

 

Thanks

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @MoayadGharaibeh 

 

In Power BI, you can create a measure to get the daily difference %. I create a sample for your reference. 

vjingzhang_1-1653274518480.png

 

Additionally, there are quick measures you can use. But I don't find a quick measure that can calculate the expected result directly, so I modify the code of one quick measure to get the above measure. Pbix file is attached at bottom.  

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

5 REPLIES 5
MoayadGharaibeh
Regular Visitor

Thank you @v-jingzhang 

 

That helped alot and now its working but:

if the previous day was Friday, i have no data for Friday, then Saturday's difference are always -100% (Check below 5/7/2022:  

MoayadGharaibeh_3-1653379291318.png

 

 

in this case i need it to calculate the difference between Sat and Thu, is there an easy way to do so?

 

and always the 1st selected date are 0%, which used to be blank in excel pivot chart, check below same chart in excel:

 

MoayadGharaibeh_2-1653379272213.png

 

Thanks again.

Moayad

Hi @MoayadGharaibeh 

 

You are welcome. You can refer to this blog about how to sort weekday names. By default, it is sorted alphabetically. So the idea is to add a number type "weekday number" column, then sort "weekday name" column by the "weekday number" column. 

 

Jing

Hi @v-jingzhang 

 

Thank you i figured out how and edited my message. Can you please check my latest edited reply?

Appreciated.

Moayad

Hi @MoayadGharaibeh 

 

Will the first date always be the month start date? If so, you can try below measure.

Price % difference from Yesterday =
VAR _CURRENT_DATE = MAX ( 'Table'[Date] )
VAR _CURRENT_WEEKDAY = WEEKDAY ( _CURRENT_DATE, 2 )
VAR _CURRENT_DAY = DAY ( _CURRENT_DATE )
VAR _BASE_DATE = IF ( _CURRENT_WEEKDAY = 6, _CURRENT_DATE - 2, _CURRENT_DATE - 1 )
VAR __BASELINE_VALUE =
    IF (
        _CURRENT_DAY = 1,
        BLANK (),
        CALCULATE (
            SUM ( 'Table'[Price] ),
            ALL ( 'Table'[Date] ),
            'Table'[Date] = _BASE_DATE
        )
    )
VAR __VALUE_TO_COMPARE = SUM ( 'Table'[Price] )
RETURN
    IF (
        NOT ISBLANK ( __VALUE_TO_COMPARE ),
        DIVIDE ( __VALUE_TO_COMPARE - __BASELINE_VALUE, __BASELINE_VALUE )
    )

 

Jing

v-jingzhang
Community Support
Community Support

Hi @MoayadGharaibeh 

 

In Power BI, you can create a measure to get the daily difference %. I create a sample for your reference. 

vjingzhang_1-1653274518480.png

 

Additionally, there are quick measures you can use. But I don't find a quick measure that can calculate the expected result directly, so I modify the code of one quick measure to get the above measure. Pbix file is attached at bottom.  

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors