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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
pstanek
Post Patron
Post Patron

Column vs Measure

I have table in Query with columns

Office cost

 

Office1   xx1 cost1

Office2   xx2 cost2

Office3   xx3 cost3

 

 

I need to add something like costn/( cost1+.....costm)

 

I would like to create table in report where office will be filtered.

When I mark Officen in the filter, result should be

 

 

Officen costn/( cost1+.....costm)

How will I create a new column in Dax? I mean column where ( cost1+.....costm) does not depend on the filter, but costn depends.

Maybe, a measure is better for that. I am not sure.

 

 

 

 

3 REPLIES 3
v-qiuyu-msft
Community Support
Community Support

Hi @pstanek,

 

Based on my understanding, when you check "Office2", you want to display the value calculated from this formula: =cost2/(cost1+cost2+cost3). Right?

 

If that is a case, I would suggest you create a measure use this expression:

 

costn/( cost1+.....costm) = DIVIDE (SUM ( 'Table2'[Cost] ),CALCULATE( SUM('Table2'[Cost]),ALL('Table2')),0)

 

Please refer to screenshots below:

 

check "Office2"check "Office4"

 

In addition, you can take a look at articles below to realize the difference between calculated columns and measures:

 

Calculated columns in Power BI Desktop

Measures in Power BI Desktop

 

If you have any question, please feel free to ask.

 

Best Regards,
Qiuyun Yu

 

 

 

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Community Champion
Community Champion

I understand cost1, but what is costn and costm in your formula, can you explain?



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Sum of all costs ,

Helpful resources

Announcements
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.