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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Resolver III
Resolver III

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors