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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Syndicate_Admin
Administrator
Administrator

How to perform the % of the difference function of (previous or later) PivotTables with Power Bi.

I need to set the percentage difference with the previous value of the same column. I have some data only by week number (they do not have date format) and I have to make the difference with the value of the previous week. With pivot table is done in a moment, the option % of the difference in .... name of the Base Week field and Previous Base Element and we already have the difference with the previous week. I can't do it easily with Dax in Power Bi.

If anyone can help me I would appreciate it. Greetings.

Xavier2609_0-1659215128259.png

Xavier2609_1-1659215166014.png

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi Admin @Syndicate_Admin , @Xavier2609 

this option is not available in power bi neither in power pivot. Only in standard pivot table. Iin both power bi and power pivot you need to write the dax code manually. I will assume the numbers to left are week numbers. Seems this column is formated as text because it is aligned left. So please first make sure it is formatted as whole number.  Then you can create a new measure 

DIVIDE ( 

SUM ( TableName[ColumnName] ),

CALCULATE ( SUM ( TableName[ColumnName] ),, TableName[Week Number] = MAX ( TableName[Week Number] ) - 1 )

)

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi Admin @Syndicate_Admin , @Xavier2609 

this option is not available in power bi neither in power pivot. Only in standard pivot table. Iin both power bi and power pivot you need to write the dax code manually. I will assume the numbers to left are week numbers. Seems this column is formated as text because it is aligned left. So please first make sure it is formatted as whole number.  Then you can create a new measure 

DIVIDE ( 

SUM ( TableName[ColumnName] ),

CALCULATE ( SUM ( TableName[ColumnName] ),, TableName[Week Number] = MAX ( TableName[Week Number] ) - 1 )

)

Perfect solution, many gràcias.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.