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

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

Reply
anaxha
Frequent Visitor

How to create additional column in matrix

Hi,

I am trying to create new column in matrix, but nothing works so far for me. The result supposed to look like this, I already have Sales Actual and Sales Forecast columns. How can I create % of Sales columns?:

Expected resultExpected result

 

1 ACCEPTED SOLUTION
v-yadongf-msft
Community Support
Community Support

Hi @anaxha ,

 

This is my test table:

vyadongfmsft_0-1661506484901.png

 

Please add a column called “Profit” in Power Query:

vyadongfmsft_1-1661506484906.png

 

Check Product column, Month column, Acutual/OP column, then Unpivot Other Columns in Transform tab.

vyadongfmsft_2-1661506484912.png

 

You will get a table like below:

vyadongfmsft_3-1661506484913.png

 

Please try following DAX:

% of sales = 
VAR Sumsales = CALCULATE(SUMX(FILTER('table','table'[Attribute]="Sales"),[Value]),ALLSELECTED('table'))
VAR SUMValue = SUM('table'[Value])
VAR percentage = IF(MAX('table'[Attribute])<>"Sales" && MAX('table'[Attribute])<>"Profit",SUMValue/SUMSales,BLANK())
RETURN percentage

 

Create a table visual and you will get result you want:

vyadongfmsft_4-1661506484917.png

 

Best regards,

Yadong Fang

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

View solution in original post

3 REPLIES 3
v-yadongf-msft
Community Support
Community Support

Hi @anaxha ,

 

This is my test table:

vyadongfmsft_0-1661506484901.png

 

Please add a column called “Profit” in Power Query:

vyadongfmsft_1-1661506484906.png

 

Check Product column, Month column, Acutual/OP column, then Unpivot Other Columns in Transform tab.

vyadongfmsft_2-1661506484912.png

 

You will get a table like below:

vyadongfmsft_3-1661506484913.png

 

Please try following DAX:

% of sales = 
VAR Sumsales = CALCULATE(SUMX(FILTER('table','table'[Attribute]="Sales"),[Value]),ALLSELECTED('table'))
VAR SUMValue = SUM('table'[Value])
VAR percentage = IF(MAX('table'[Attribute])<>"Sales" && MAX('table'[Attribute])<>"Profit",SUMValue/SUMSales,BLANK())
RETURN percentage

 

Create a table visual and you will get result you want:

vyadongfmsft_4-1661506484917.png

 

Best regards,

Yadong Fang

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

amitchandak
Super User
Super User

@anaxha , If sales is a value in a table column then

 

divide([Measure], calculate([Measure], filter(all(Table[KPI]) , Table[KPI] ="Sales"))

 

but if you have done this using calculation groups, refer I tried a few combinations here. if those can help

Calculation Groups- Measure Slicer, Measure Header Grouping, Measure to dimension conversion. Complex Table display : https://youtu.be/qMNv67P8Go0

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi, 

Thank You for the answer. I wasn't precise. My data looks something like this, so in this case I don't have any measures:

image.png

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.