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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
jdobler
New Member

Percentage from filtered table

Hello eveyone,

 

I'm deperating in solving this problem.

If do have a table and from this I need to calculate the average quote, but whenever I filter this table the quote gets wrong.

 

Example of my table:

AreaWeight OrderedWeight DeliveredTypeMonthQuote
112,312,3a2022-01100,00%
114,313,3a2022-0293,01%
116,316,3a2022-03100,00%
118,318,3a2022-04100,00%
320,320,3a2022-01100,00%
322,321,3a2022-0295,52%
324,324,3a2022-03100,00%
326,326,3a2022-04100,00%
328,328,3a2022-03100,00%
330,325,4b2022-0283,83%
532,332,3b2022-01100,00%
534,334,3b2022-02100,00%
536,336,3b2022-03100,00%
538,338,3b2022-04100,00%
540,30b2022-030,00%
542,342,3b2022-03100,00%
544,347,2c2022-02106,55%
546,348,23c2022-01104,17%
748,322,5c2022-0146,58%
750,348,6c2022-0296,62%
752,350,2c2022-0395,98%
754,354,3c2022-04100,00%
956,356,3c2022-01100,00%

 

As Power BI Desktop translated my Month field to a date field I created a new column with the following: 

  MonthFormDate = FORMAT(Tabelle3[Month],"YYYY-MM")
 
Here I get the values from Year with 4 digits and a dash and after that I get the month added with 2 digits.
 

I want to display the values in a graph and therefore I created a new file and added a graph visual.

jdobler_0-1654686279017.png

In the image you will see that the weight ordered has a value of 240,10 and the weight delivered has 197,70.  Therefore the value of the quote should be: 197,70 / 240,10 = 82,34 %, but the display says 85,14%.

I know what does Power BI does here and it calculate every single line and after that it calculates the quote field.  I set the displayof the quote to SUM and AVERAGE, but in any case I do not get the correct value of 82,34%.

 

It becomes more and more difficult as there should be some filtering done as well. As shown in the example berlow.

jdobler_1-1654686593620.png

These is only an example, but I guess it show my problem and hope one of you can help me with this.

 

Thanks a lot in advance.

 

Johannes Dobler

 

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @jdobler 

 

You need to create a measure to calculate the percentage. The measure also works well when you add filters to the report. 

Quote % = DIVIDE(SUM('Table (2)'[Weight Delivered]),SUM('Table (2)'[Weight Ordered]))

vjingzhang_0-1655105599761.png

 

I have attached a sample file at bottom. 

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

1 REPLY 1
v-jingzhang
Community Support
Community Support

Hi @jdobler 

 

You need to create a measure to calculate the percentage. The measure also works well when you add filters to the report. 

Quote % = DIVIDE(SUM('Table (2)'[Weight Delivered]),SUM('Table (2)'[Weight Ordered]))

vjingzhang_0-1655105599761.png

 

I have attached a sample file at bottom. 

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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