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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Excel PT functionallity in Power BI : Show Values As - Difference From

Hi,

 

I have an Access DB which feed data into ane Excel Data Model and Power BI. This is the weekly reporting cash balances of a couple companies.

 

2.PNG

 In Excel is quite easy to do the calculation I want: "Show Values As", "Difference From" "Previous".

4.PNG5.PNG

 

 And VOILA!! I've the calculculation i want, which is the difference between the current and the previos column (reporting date):

6.PNG

 

 How is this done in Power BI? I've tried some DAX with no success: CALCULATE + SAMEPERIODLASTYEAR or PARALELL or ALL , ETC.

 

 In advance thanks for your support.

 

Oscar

1 REPLY 1
DataInsights
Super User
Super User

As a thought experiment, I created the measure below that mimics the "Show Values as Difference From" option in a pivot table. Normally, date calculations are performed on a date table. But, if you're looking for a quick "current vs. previous period", this might be of interest. It subtracts the previous amount from the current amount, whether the period is year, quarter, month, week, or day. The only table in this data model is FactTable.

 

Difference From = 
VAR vDate =
    MAX ( FactTable[Date] )
VAR vPreviousDate =
    CALCULATE (
        MAX ( FactTable[Date] ),
        ALLSELECTED ( FactTable[Date] ),
        FactTable[Date] < vDate
    )
VAR vAmount = [Sum of Amount]
VAR vPreviousAmount =
    CALCULATE ( [Sum of Amount], FactTable[Date] = vPreviousDate )
VAR vResult =
    IF ( vPreviousDate <> BLANK (), vAmount - vPreviousAmount )
RETURN
    vResult

 

DataInsights_0-1664802492288.png

 





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

Proud to be a Super User!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.