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
cpiolla
Regular Visitor

How to add a measure's result of many lines

Hi everyone!

I am currently working on a table that relates the amount of components that my company receives and returns.
Here is how the table is at this moment:

cpiolla_0-1667993929555.png

"Cod. Forn. Principal" is an ID.

"Entradas_bus" are the received components.
"Refugos_bus" are the components we have returned.
"Impacto_PPM" is calculated by a measure. It's the returned pieces of one ID divided by the SUM() of all received pieces during an interval of time.

"Porcentual PPM" is the % that each line represents in the total of 'Impacto_PPM'. Basically, I want to know how much % does 829,27 represents out of the total 'Impacto_PPM'.

Right now I'm struggling to calculate the "Porcentual PPM" because I can't find a way to get the summation of all lines in the "Impacto_PPM" column. 


can somebody help me please

 

 

1 ACCEPTED SOLUTION
zerotyper
Frequent Visitor

@carlosbpiolla I hope this is the result you want.

zerotyper_0-1668172664587.png

 

View solution in original post

13 REPLIES 13
zerotyper
Frequent Visitor

@carlosbpiolla I hope this is the result you want.

zerotyper_0-1668172664587.png

 

Thank you @zerotyper !!! That's what I wanted!

v-yueyunzh-msft
Community Support
Community Support

Hi, @cpiolla 

For your need , you can try to use this dax to create a measure :

PPM % = var _t = SUMMARIZE(ALL('Table'[Cod. Forn. Principal]) , 'Table'[Cod. Forn. Principal] , "PPM" , [Impacto_PPM] )
return
DIVIDE([Impacto_PPM],SUMX(_t,[PPM]))

Then we can meet your need , the result is as follows:

vyueyunzhmsft_0-1668053378699.png

 

 

Best Regards,

Aniya Zhang

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

Hello @v-yueyunzh-msft . Thank you for your time and for trying to help!

But just like my reply to our other friend, it didn't work...the results are the same.

cpiolla_0-1668080891154.png

 

Hi , @cpiolla 

Can you check the measure type is "Percentage" in "Measure Tools"?

vyueyunzhmsft_0-1668129278943.png

If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

 

Best Regards,

Aniya Zhang

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

Hey, @v-yueyunzh-msft  !! This is my personal account.

 

What I need is that the column %PPM looks like this.
Remember that both 'Impacto PPM' and '% PPM' are measures and not columns in the original table.

 

Cod. Forn. PrincipalEntradasRefugosImpacto PPM% PPM
160328358.839,001.200,00834,9182,47
1568675016.300,0094,00

65,4

6,46
1569933320.584,0076,0052,885,22
1569512639.720,0060,0041,754,12
153125007.600,0020,0013,921,38
1595630092.589,004,002,780,27
112230003.190,001,000,7

0,069

and many more.........................
TOTAL:1.437.27814551012,34100%

 

Here is the pbix file with this data.

samples.pbix 

 

Thanks again for helping!

 

 

 

johnt75
Super User
Super User

Try this as the measure

Porcentual PPM =
DIVIDE ( [Impacto PPM], CALCULATE ( [Impacto PPM], ALLSELECTED () ) )

First of all, thanks for trying to help me out!
But unfortunately it doesn't work, the numbers don't add up to 100% 😞

cpiolla_0-1668022288601.png

 

FreemanZ
Super User
Super User

Supposing your table named Table, try to add a new column with the code below:
 
Porcentual PPM = FORMAT ( DIVIDE( CALCULATE(SUM('Table'[ Impacto_PPM])), SUM('Table'[ Impacto_PPM])), "00%")

Hi FreemanZ, thanks for helping!
But the 'Impact_PPM' you see on the picture is not an actual column on the table, it's just a measure as a column in a table visual.

 

Can you simplify your report and upload the pbix file?

Hey, @FreemanZ !! This is my personal account.

 

The situation is: the measure 'Porcentual PPM' is supposed to calculate the percentage that each 'Impact PPM' (which is also a measure) has on the total of the 'Impact PPM'. But theres is something wrong and I cant solve it.

Here's the pbix file with a few numbers on it.
samples.pbix 
Thanks again for helping.

It seems you put it on OneDrive, but i couldn't open it. 

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.

Top Solution Authors