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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Nauman
Frequent Visitor

Dax Measure for P&L vertical Analysis

Dear Experts,

I am seeking assistance in creating a measure to calculate the percentage of Sales for all the amounts in the "Sub-Type" column of my profit and loss table. Unfortunately, I have not been able to obtain the desired result so far. Initially, I attempted to calculate the total sales and then divide each line item by this value using a measure called "Vertical Analysis." However, this approach only provides the percentage for the Sales item, leaving the other line items such as COGS and other OpEx items blank.

I would greatly appreciate any help you can provide to address this issue.

Thank you in advance.

 

@Ashish_Mathur 

 

Total Sales =
CALCULATE(
    SUM(PL_Unpivot[Amount]),'PL-Category'[Category]= "Sales"
 
Vertical Analysis = ([Total Sales] / CALCULATE([Total Sales],ALL(PL_Unpivot[Sub-Type])))
5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PBI file and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi Ashish,

Please find below the screenshot of my desired result (Yellow highlighted columns), where each line item is divided by the total sales or net revenue.

 

Nauman_0-1687957470833.png

 

below is my data model

Nauman_0-1687960293322.png

 

As requestd in my previous message, share the download link of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
eliasayyy
Memorable Member
Memorable Member

hello your measure total sales is only calculating catehory = sales so anything ese will return 0 unless its sales so in vertical analysis, 
instaed of CALCULATE([Total Sales],ALL(PL_Unpivot[Sub-Type])))
use CALCULATE(SUM([amount]),ALL(PL_Unpivot[Sub-Type])))

The measure is still yielding the same result. However, the measure provided below is functioning to some extent by dividing each category's total by its corresponding line item. However, what I actually want is to divide all the line items by the total sales. For instance, if we have a total sales of 100, COGS of 50, and a purchase amount of 25, the percentage should be calculated as 25% (i.e., 25/100), rather than 25/50 (the total of COGS)

 

Vertical Analysis = DIVIDE(SUM(PL_Unpivot[Amount]),
    CALCULATE(SUM(PL_Unpivot[Amount]),
        ALL(PL_Unpivot[Sub-Type])))

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.