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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
PBInewbie17
Helper I
Helper I

Matrix Values Reflecting Blank Instead of 0

I have a Power BI Matrix with Rows comprised of PHA_CD_NM and the DVLPT_NUM within each PHA_CD_NM. I have three separate measures I’ve included as columns within the Matrix. The problem is that Average Vacant Days (DDA) and Average Vacant Days (Non DDA) are calculating as blank values instead of 0 (when applicable). Can anyone help me adjust these formulas so blank items appear as 0? The formulas for each measure are below.

PBInewbie17_0-1688582267403.png

Average Vacant Days =
VAR AvgVacDays =
    DIVIDE(SUM('F_T_UNIT'[VAC_DAYS]), SUM('F_T_UNIT'[UNIT_CNT]))

VAR IsBlankAvgVacDays =
    ISBLANK(AvgVacDays)
RETURN
    IF(
        IsBlankAvgVacDays,
        IF(
            ISINSCOPE('D_PHA'[PHA_CD_NM]),
            IF(
                NOT ISINSCOPE('D_DEVELOPMENTS'[DVLPT_NUM]),
                0,
                AvgVacDays
            ),
            BLANK()
        ),
        AvgVacDays
    )
 
Average Vacant Days (DDA) =
VAR AvgVacDaysDDA =
    CALCULATE(
        [Average Vacant Days],
        'F_T_UNIT'[UNIT_DDAPP_INDR] = "Y"
    )
VAR IsBlankAvgVacDaysDDA =
    ISBLANK(AvgVacDaysDDA)
RETURN
    IF(
        IsBlankAvgVacDaysDDA,
        IF(
            ISINSCOPE('D_PHA'[PHA_CD_NM]),
            IF(
                NOT ISINSCOPE('D_DEVELOPMENTS'[DVLPT_NUM]),
                0,
                AvgVacDaysDDA
            ),
            BLANK()
        ),
        AvgVacDaysDDA
    )
 
Average Vacant Days (Non DDA) =
VAR AvgVacDaysNonDDA =
    CALCULATE(
        [Average Vacant Days],
        'F_T_UNIT'[UNIT_DDAPP_INDR] <> "Y"
    )
VAR IsBlankAvgVacDaysNonDDA =
    ISBLANK(AvgVacDaysNonDDA)
RETURN
    IF(
        IsBlankAvgVacDaysNonDDA || AvgVacDaysNonDDA = BLANK(),
        IF(
            ISINSCOPE('D_PHA'[PHA_CD_NM]),
            IF(
                NOT ISINSCOPE('D_DEVELOPMENTS'[DVLPT_NUM]),
                0,
                AvgVacDaysNonDDA
            ),
            0
        ),
        AvgVacDaysNonDDA
    )
3 REPLIES 3
lbendlin
Super User
Super User

Add 0 to your measure.

 

In general, To report on things that are not there you need to use disconnected tables and/or crossjoins

Can you please elaborate? Where would I add the 0? I am still learning. Thanks!

Average Vacant Days (Non DDA) =
VAR AvgVacDaysNonDDA =
    CALCULATE(
        [Average Vacant Days],
        'F_T_UNIT'[UNIT_DDAPP_INDR] <> "Y"
    )
VAR IsBlankAvgVacDaysNonDDA =
    ISBLANK(AvgVacDaysNonDDA)
RETURN 0 + 
    IF(
        IsBlankAvgVacDaysNonDDA || AvgVacDaysNonDDA = BLANK(),
        IF(
            ISINSCOPE('D_PHA'[PHA_CD_NM]),
            IF(
                NOT ISINSCOPE('D_DEVELOPMENTS'[DVLPT_NUM]),
                0,
                AvgVacDaysNonDDA
            ),
            0
        ),
        AvgVacDaysNonDDA
    )

Something like this.  It's more of a hack. Would be better if your measure would not run into such a scenario.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.