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
desspirova
New Member

DAX command to multiply by 100% a.k.a. x is what % of y

Hi,

 

I'm quite new to Power BI and what I'm trying to do is a report on Power BI desktop tracking expenses vs budget. For one of my tables, I want to show a columnt with the current spent (I've done that), a column with the budget (done that too) and another column to show the % of the budget that has been consumed already. So basically x (current spent) is what % of y (budget). I tried the below but it didn't work

Consumed = CALCULATE(DIVIDE(SUM('Data23n24'[Current spent]), SUM('BugetFY24'[Total FY24 estimate]))*100%)

 

Any suggestions how to fix the syntax? 

 

Thanks in advance!

1 ACCEPTED SOLUTION
v-kaiyue-msft
Community Support
Community Support

Hi @desspirova ,

 

Thanks @DAX_Machine  for sharing, here are some suggestions, I hope they can be helpful to you.
Based on your description, I created two tables.

vkaiyuemsft_0-1711609210044.png
vkaiyuemsft_1-1711609210045.png

 

1. If you want to calculate the percentage of each row's cost to the total budget, you can write an expression.

Column =
CALCULATE(DIVIDE(SUM('Table'[current spent]),SUM('Table 2'[budget])))

And select "%" in column tools to format the result as a percentage. The number 2 means keeping two decimal places. You can adjust it according to your needs.

vkaiyuemsft_2-1711609253519.png

 

2. If you want to calculate the total cost as a percentage of the total budget, you can write an expression.

Column 2 =
DIVIDE(SUM('Table'[current spent]),SUM('Table 2'[budget]))


It also needs to be changed to percentage format.

vkaiyuemsft_3-1711609264141.png

 

The final result is shown below.

vkaiyuemsft_4-1711609288090.png

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

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

2 REPLIES 2
v-kaiyue-msft
Community Support
Community Support

Hi @desspirova ,

 

Thanks @DAX_Machine  for sharing, here are some suggestions, I hope they can be helpful to you.
Based on your description, I created two tables.

vkaiyuemsft_0-1711609210044.png
vkaiyuemsft_1-1711609210045.png

 

1. If you want to calculate the percentage of each row's cost to the total budget, you can write an expression.

Column =
CALCULATE(DIVIDE(SUM('Table'[current spent]),SUM('Table 2'[budget])))

And select "%" in column tools to format the result as a percentage. The number 2 means keeping two decimal places. You can adjust it according to your needs.

vkaiyuemsft_2-1711609253519.png

 

2. If you want to calculate the total cost as a percentage of the total budget, you can write an expression.

Column 2 =
DIVIDE(SUM('Table'[current spent]),SUM('Table 2'[budget]))


It also needs to be changed to percentage format.

vkaiyuemsft_3-1711609264141.png

 

The final result is shown below.

vkaiyuemsft_4-1711609288090.png

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

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

DAX_Machine
Frequent Visitor

Hi!
Why not try to do it as a measure instead of a calculated column?
For that You will first need to sum your currentspent as a seperate measure, then sum your Budget as another measure, then create this one. Or if you prefer to have all in one measure you can work with variables.

This measure will calculate the diffrence between current spent and budget in %
DIVIDE([yourCurrentspentmeasure],
           [YourBudgetMeasure]
         ) - 1
Then you can format this measure as a percentage to display your value as a percent.

Try this and let me know if that helped!

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.