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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Crav888
Frequent Visitor

Dividing two columns after they have been filtered

Hi,

 

I have looked around the forum and I can't seem to find a satisfying answer on my issue.

 

What I want to do is to visualise my data in a table or something similar:

 

I want to see the following:

 

Plant             Cost Type name                  Difference between WOD and CCC in Internal and Spare parts

Plant a        (Internal + spare parts)         (Sum of WOD/sum of CCC)

Plant b        (Internal + spare parts)         (Sum of WOD/ sum of CCC)

Plant c        (Internal + spare parts)         (Sum of WOD/ sum of CCC)

 

My data looks is somewhat similar to the example below:

 

Plant             Cost Type name                                CCC                         WOD

Plant a            Internal                                            10                                 2

Plant a             External                                           2                                   12

Plant b             Internal                                           1                                    1

Plant b             External                                          4                                     4

Plant b            Spare parts                                     7                                     10

Plant a            Internal                                            4                                    5

Plant a             External                                           3                                   3

Plant b             Internal                                           8                                   9

Plant b             External                                          19                                    5

Plant b            Spare parts                                      3                                    12

Plant c             Internal                                           8                                   2

Plant c             External                                          4                                    5

Plant c            Spare parts                                      3                                    12

 

This is my first post to Power Bi community, so I apologize for the lack of correct lingo and visualisation.

 

I look forward to your answers 🙂

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Crav888,

 

>>Now I have two Plant A001 rows. I just want one Plant A001 that shows external cost and spare part cost for WOD and divides that with external cost and spare part cost for CC

Remove the 'cost type name' column from the visual and you will get the summary result which you wanted.

 

Regards,

Xiaoxin Sheng

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @Crav888,

 

Actually you not need to add an external filter on this formula, power bi will auto filter the measure to calculate on current filtered records.

Result = SUM('sample'[WOD])/SUM('sample'[CCC])

4.PNG

 

BTW, when your calculation will break current filters, then you need to add some additional filter in the formula.

 

For example: I want to know the percent of current selected and unfiltered records.

Pecent of current Plant = 
var currentPlant=LASTNONBLANK('sample'[Plant],[Plant])
Return
SUM('sample'[WOD])/SUMX(FILTER(ALL('sample'),[Plant]=currentPlant),[WOD])

 

Regards,

Xiaoxin Sheng

Thank you so much for your help. I can follow some of the logic 🙂

 

However, I want the table to give one result for Plant A, one result for Plant B etc.

 

Plant A: (Summarized Internal WOD + summarized spare parts WOD) / (Summarized Internal CCC + summarized spare parts CC)

Plant B: (Summarized Internal WOD + summarized spare parts WOD) / (Summarized Internal CCC + summarized spare parts CC)

 

Furthermore, I get the same result for all the plants. Not sure how to fix it.

 

Plant Maintenance PPI 1 help.PNG

 

I want something like this:

However, the two columns do not match with the result in the column :S

Capture.PNG

 

That is so great.

 

One last thing - I think.

 

Now I have two Plant A001 rows. I just want one Plant A001 that shows external cost and spare part cost for WOD and divides that with external cost and spare part cost for CC

 

Capture.PNG

 

Is thas possible?

Anonymous
Not applicable

Hi @Crav888,

 

>>Now I have two Plant A001 rows. I just want one Plant A001 that shows external cost and spare part cost for WOD and divides that with external cost and spare part cost for CC

Remove the 'cost type name' column from the visual and you will get the summary result which you wanted.

 

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

Hi @Crav888,

 

My formula is measure, if you direct put it as calculated column, it will get the static value of all table.

 

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors