Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hey guys! i am pretty Sure this so easy for you! but i need to calculate a porcentage! having this table on Power BI
A | B |
5 | 12.5 |
12 | 20.1 |
10 | 11.5 |
Total 27 | Total 44.1 |
So i need to divide every single one of B / the total of A for example:
12.5 / 27 =
20.1 / 27 =
Been using Porcentage = divide ( B ; sum(A))
Something like that, not writting all the formula, Thank you so much! this is my first post
Solved! Go to Solution.
Okay, change your formula to use ALLSELECTED instead of ALL and see if your filters work.
So:
While im using
Set up your measure like this:
So in your case it would be:
---
Please hit the "Accept as Solution" button if my post answered your question! If my post was helpful please consider giving it a "Thumbs Up."
thank you for helping me!
i have seen that i am using some date filters, and that filter is affecting me if i take that filter off, is giving me the exact result! but i dont know how to apply it to the code you just gave me
On your visual, select "New Measure"
Give your measure a name, or just leave it called Measure, then enter the formula: (I removed some of the noise in my model so this example looks a little cleaner)
Then add the measure to your visual, in this case I'm adding it to the table: (I also selected the measure and increased the number of decimal places)
---
Please hit the "Accept as Solution" button if my post answered your question! If my post was helpful please consider giving it a "Thumbs Up."
Pretty sure im on that way! the date filter is in
Is in spanish but it is a date! haha
If you remove the date filter, do you get the correct percentages?
Actually i have 2 filters, "Estado" is the other one! when i remove both of them, i get the correct porcentages
Okay, change your formula to use ALLSELECTED instead of ALL and see if your filters work.
So:
OMMG! YEEEES Thank you so much! really appreciate your time
What's happening is that the ALL portion of the formula is resulting in the denominator for your percentage always being the same. So when you apply a filter it changes the value of [Mora Real] being used, but the denominator continues to be the sum of [SALDOCAP] across the entire table.
Hi @panchinxd ,
You can create measure or column like DAX below.
Measure1 = DIVIDE(SUM('Table'[B]),CALCULATE(SUM('Table'[A]),ALL('Table')))
Column1 = DIVIDE('Table'[B],CALCULATE(SUM('Table'[A]),ALL('Table')))
Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hey Amy!
Thanks for your support but, i have this report filter by date, so i am just showing some specific date, thats why i am not getting the specific porcentage (i think) it gives me a little bit more, not sure if filters are afected by this code, or i have to add another code
You can add a Custom Column in the Query Editor. Select the first column then press / then select the second column then put *100 at the end. Afterwards, change the column type to %
---
Please hit the "Accept as Solution" button if my post answered your question! If my post was helpful please consider giving it a "Thumbs Up."
Thank You for answer me!
What i have seen, is that it does not divide the Sum of A, it does it individually! for example B / A and i need B / sum(A)
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
136 | |
118 | |
101 | |
71 | |
61 |