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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
gaccho_na
New Member

How to create composition ratio in powerBI

Hello,

 

I want to display output table B from data table A.

Too difficult for me.

Please Help me !

 

data table A

DateDIVvalue
2020/04Net Sales600,000
2020/04Cost of Sales300,000
2020/04Gross Profit300,000
2020/04SGA expenses120,000
2020/04Operating income180,000
2020/05Net Sales800,000
2020/05Cost of Sales390,000
2020/05Gross Profit410,000
2020/05SGA expenses125,000
2020/05Operating income285,000
2020/06Net Sales500,000
2020/06Cost of Sales260,000
2020/06Gross Profit240,000
2020/06SGA expenses120,000
2020/06Operating income120,000

 

output table B

 TTL Valuecomposition ratio 
Net Sales1,900,000100.0% 
Cost of Sales900,00047.4%Cost of Sales / Net Sales
Gross Profit1,000,00052.6%Gross Profit / Net Sales
SGA expenses400,00021.1%SGA expenses / Net Sales
Operating income600,00031.6%Operating income / Net Sales

 

1 ACCEPTED SOLUTION
daXtreme
Solution Sage
Solution Sage

// Base measure
[Total Value] = SUM( 'Table'[Value] )

[Composition Ratio] =
var NetSalesAmount = 
    CALCULATE(
        [Total Value],
        'Table'[DIV] = "Net Sales"
    )
var Result =
    DIVIDE(
        [Total Value],
        NetSalesAmount
    )
return
    Result

View solution in original post

2 REPLIES 2
daXtreme
Solution Sage
Solution Sage

// Base measure
[Total Value] = SUM( 'Table'[Value] )

[Composition Ratio] =
var NetSalesAmount = 
    CALCULATE(
        [Total Value],
        'Table'[DIV] = "Net Sales"
    )
var Result =
    DIVIDE(
        [Total Value],
        NetSalesAmount
    )
return
    Result
Smalfly
Responsive Resident
Responsive Resident

Hi @gaccho_na ,

 

please have a look at this expample file and let me know if this helps you to solve your issue.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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