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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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