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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
jdecker999
Regular Visitor

help - i need to add a 3rd and 4th column to visual table that can calculate the difference and %

hi team, i created a visual from a table that is rows by weeknum, and columns by year i add the qty by year and group by weeknum.

 

i now need to take year 2023 and subract year 2022 and get the percentage change.power bi from 1 tablepower bi from 1 tableneeds to look like thisneeds to look like this

3 REPLIES 3
tamerj1
Super User
Super User

Hi @jdecker999 

most probably this possible but the solution is difficult to explain without a sample file. If possible please provide a dummy sample file. 

MAwwad
Solution Sage
Solution Sage

 

To add a third and fourth column to calculate the difference and percentage change between 2023 and 2022, you can create two new measures. Here are the steps:

  1. Go to the "Fields" pane and select the table you're working with.
  2. Click on the "New measure" button in the ribbon.
  3. For the first measure, use the following DAX formula:

 

 
Diff 2022-2023 = [2023] - [2022]
 
  1. For the second measure, use the following DAX formula:

 

 
% Change 2022-2023 = DIVIDE([Diff 2022-2023], [2022])
 
  1. Add these two new measures to the table visual, as columns.

This will give you two new columns in the table visual that show the difference between 2023 and 2022, and the percentage change between the two years.

thanks for suggestion, but the data is not in two separate columns in the fields table.  it is in the same column called qty and the same column called dateofservice. my visual above shows table created in visual by row by week and sum of qty by column- year.  so my question is, how to take the columns i see in the visual and create a percent from them?

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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