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
nishthabhakta20
Frequent Visitor

Power BI Division problem

Hi ,

I am working on Power BI Desktop to find ratio. Basically division of two measure.

 

Here is the measure:

Measure Is Excluding AOC =
SUMX(
    'table1',  
    IF(
        'table1'[AOC_TYPE] <> "Not AOC" &&
        NOT(ISBLANK('V_DW_SB_2024_20240627'[SCHEDULED_MONTH])),
        0,
        1
    )
)
Measure Is Excluding AOC and NoStat =
SUMX(
    'table1',  
    IF(
        'table1'[AOC_TYPE] = "Not AOC" &&
        'table1'[NO_ACCESS_STATUS] <> "Contractor Fail" &&
        NOT(ISBLANK('V_DW_SB_2024_20240627'[DATE_COUNTED])) &&
        'table1'[STATUS] IN {"No Longer in Scope", "v1 Complete", "v1 No Access", "v1 No Clearance Required", "v1 No Structure Found", "v1 Partial Clearance"},
        1,
        0
    )
)
Result for Measure Excluding AOC:
nishthabhakta20_0-1719780807058.png

Result for Measure Excluding AOC and NotStat:

nishthabhakta20_1-1719780867706.png

Ratio Result by manual calculation in Excel:

Ratio= Measure Excluding AOC and NotStat/Measure Excluding AOC

nishthabhakta20_2-1719780911456.png

 

Power BI incorrect result:

nishthabhakta20_3-1719780998903.png

Power BI Formula:

DivideResult3 = DIVIDE([Measure Is Excluding AOC and NoStat],[Measure Is Excluding AOC])
 
Please help me to find out how I can find the correct result for finding ratio formua

 

2 REPLIES 2
VN999
Resolver I
Resolver I

Please compare and check  xl used code and Power BI used code both same or not ?

Please double check in this below meausre conditions out come 1, 0 in right order or  not? I feel like it should be 0,1.

 

Measure Is Excluding AOC and NoStat =
SUMX(
    'table1',  
    IF(
        'table1'[AOC_TYPE] = "Not AOC" &&
        'table1'[NO_ACCESS_STATUS] <> "Contractor Fail" &&
        NOT(ISBLANK('V_DW_SB_2024_20240627'[DATE_COUNTED])) &&
        'table1'[STATUS] IN {"No Longer in Scope""v1 Complete""v1 No Access""v1 No Clearance Required""v1 No Structure Found""v1 Partial Clearance"},
        1,
        0
    )
)

 

If Still issue not resolved then start code debugging by comment one by one conditions in second Measure?

 

Good Luck!

 

 

Still struggling with the same issue. I tried changing the sequence for 0 and 1 in the formula

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.