cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors