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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
abukapsoun
Post Patron
Post Patron

Calculated column formula

Hi experts,

Need your support please 

 

I have the following two table

 

ColA   ColB   ColC

X          17     P01

X          19     P01

Y          30     P02

Y          15     P02

Z          15     P03

 

ColAA  ColBB

P01       20

P02       20

P03       25

 

I want to calculate the % of ColB based on the input of ColBB.. meaning something like ColB/ColBB x 100 

 

so the end result would like that 

ColA   ColB   ColC

X          90%     P01

X          85%     P01

Y          ..%     P02

Y          ..%     P02

Z          ..%     P03

 

How can achieve this?

 

thank you very much in advanced

 

Thanks

1 ACCEPTED SOLUTION

Hi,

 

It worked absolutely fine! Thank you very much. 

Another question please. 

Now I want to display those values, I have used the matrix table to show each period. However the total displayed is the sum of both periods while I am looking to have it as an average. 

 

 

 11.JPG

When I use change the type to average, the values dont look correct. 

What do you suggest to correct it? Maybe if there is even another way without using the matrix table istead

 

22.JPG

 

Thank you very much

 

@v-yulgu-msft 

View solution in original post

3 REPLIES 3
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @abukapsoun ,

 

New a calculated column in the first table.

ColB/ColBB = [ColB]/LOOKUPVALUE(Table2[ColBB],Table2[ColAA],Table1[ColC])

1.PNG

 

Alternatively, you could establish a one to many relationship between two tables. Then, use below DAX formula.

ColB/ColBB = [ColB]/RELATED(Table2[ColBB])

2.PNG3.PNG

 

Best regards,

Yuliana Gu

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

Hi,

 

It worked absolutely fine! Thank you very much. 

Another question please. 

Now I want to display those values, I have used the matrix table to show each period. However the total displayed is the sum of both periods while I am looking to have it as an average. 

 

 

 11.JPG

When I use change the type to average, the values dont look correct. 

What do you suggest to correct it? Maybe if there is even another way without using the matrix table istead

 

22.JPG

 

Thank you very much

 

@v-yulgu-msft 

Hi @abukapsoun ,

 

Since the original question has been worked out, would you please kindly accept it as an answer so that it can benefit others? For any other question, I would suggest you post a new thread on this forum, so that more community menbers can view it and provide solutions.

 

Best regards,

Yuliana gu

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.