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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Divide per Category, combining Products

Hi all,

 

I'm currently facing an issue with a divide measure in Power BI.

Here's a simplified version of my data:

ZGA_M_1-1719235884680.png

 

I want to create a measure for the last column that calculates Measure 1 divided by Measure 2. The desired result should look like this:

ZGA_M_2-1719236115511.png

 

The challenge is that I need this measure without grouping the products, as new products are frequently added. I've attempted to use the REMOVEFILTERS and ALL functions, and I have managed to create two separate measures successfully, but combining measures ends in an incorrect total value. 

 

Could anyone suggest an approach to solve this using DAX?

Thank you!

3 REPLIES 3
Ankur04
Resolver II
Resolver II

Hi,

 

can you explain how come the for category D the measure values is becoming 8?

 

 

 

 

JohnAPD
Frequent Visitor

If this is the case then you could create a filter measure to use in the filter pane:

BooleanInclude = 
 VAR _Msr1 =
    CALCULATE ( SUM ( 'Table'[Measure1] ) )
VAR _Msr2 =
    CALCULATE ( SUM ( 'Table'[Measure2] ) )
RETURN
    IF (
        OR ( ISBLANK ( _Msr1 ), ISBLANK ( _Msr2 ) ),
        0,
        1
    )

JohnAPD_0-1719239783147.png

Measure (Measure 1 / Measure 2) = 
DIVIDE (
    CALCULATE ( SUM ( 'Table'[Measure1] ) ),
    CALCULATE ( SUM ( 'Table'[Measure2] ) ),
    BLANK ()
)
JohnAPD
Frequent Visitor

Hi @Anonymous can you clarify the value of Product D in Category C Changed from blank to 8 is this intentional?

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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