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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

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