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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.