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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mayork
Regular Visitor

Power BI % change based on columns.

I am new to power bi and am slowly learning as I go. 

 

I have several columns brought into power BI.

 

Eg.

 

2020 Vol, 2019 Vol, Vol Variance.

 

I want to show the absolute volume variance which is what I see, but I also want to be able to divide it into the base year to show a percentage change vs the prior year.  I believe I want to do this by adding a column but I have not yet mastered the language to get it to do what I need.

 

Can you help.  

 

 

1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi @mayork , 

You could refer to my sample for details

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Greg_Deckler
Super User
Super User

@mayork Not entirely certain, but perhaps:

 

New Column = DIVIDE([2020 Vol] - [2019 Vol], [2019 Vol])

or perhaps just

New Column = DIVIDE([2020 Vol], [2019 Vol])​

If none of that helps, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi Greg, thanks for trying to help.

 

That didnt seem to work.  What I would do normally in excel is divide the var - eg 1,729 into the base volume of 7,825 and it would give me 22% as the change.  

 

2020 Volume 2019 Volume Var% Change
6096                      7,825                     (1,729)-22%
4242                      4,470                         (228)-5%
dax
Community Support
Community Support

Hi @mayork , 

You could try below measure

Measure 2 = ABS(DIVIDE(MIN('Table'[2020 Volume])-MIN('Table'[ 2019 Volume ]),MIN('Table'[ 2019 Volume ])))

 

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

mayork
Regular Visitor

Capture2020.JPG

Can anyone help with this?  I can get it to work on the individual lines, but the total line (eg customer 1 and customer 2) add the two variances together instead of doing the calculation on the total as well.  So for example -40 percent is incorrect, but -11 and -30 are correct.   I feel like its some small thing that I am not doing.  @Greg_Deckler  @dax 

dax
Community Support
Community Support

Hi @mayork , 

You could refer to my sample for details

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

mayork
Regular Visitor

The more I look at this more I realize there is just something not working how I want it to.

 

There are two products types that make up the line item that does not appear to have the correct % change on the total line.  The matrix format is summing up the 11+30 and making it 40% instead of recalculating on the total.  Is there somewhere I can indicate that it should calculate the % change at all total levels and not just add up the two lower level % change totals?

 

 

 2020 volume 2019 Volume Volume VarVar %  
Total2574635251                     (9,505)-40% should be -27% - Is summing below percentages
Product Type 14396                      4,913                         (517)-11%  
Product Type 221350                    30,338                     (8,988)-30%  

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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