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
Tiger2514555
Helper III
Helper III

Matrix returns some blank values.

Tiger2514555_0-1700118769540.png


I've noticed that if an item has more than one value in a column, it returns blank, which I don't know how to fix. For anyone who is wondering What my 'DemandSummaryAPS'[Check] does is I take the data for week 45 and subtract it from 44. Some of my data only have 44 or 45, not both 44 and 45. If there is data for week 45, set it to 2. If it's 44, set it to 3 in 'DemandSummaryAPS'[Check]

Tiger2514555_1-1700119342442.png

 


My DAX

Week By Week =

VAR FilteredTable =
    FILTER(
        'DemandSummaryAPS',
        'DemandSummaryAPS'[demandID] = 'DemandSummaryAPS'[demandID] &&
        'DemandSummaryAPS'[item] = 'DemandSummaryAPS'[item] &&
        'DemandSummaryAPS'[Week Num Due] = 'DemandSummaryAPS'[Week Num Due]
        && 'DemandSummaryAPS'[Check] = 1 || 'DemandSummaryAPS'[Check] = 2 || 'DemandSummaryAPS'[Check] = 3
    )

VAR _max_demand_id =
    MAXX(FilteredTable, 'DemandSummaryAPS'[demandID])

VAR _min_demand_id =
    MINX(FilteredTable, 'DemandSummaryAPS'[demandID])

VAR _max_week_num =
    MAXX(FilteredTable, 'DemandSummaryAPS'[Week Num Create])

VAR _min_week_num =
    MINX(FilteredTable, 'DemandSummaryAPS'[Week Num Create])

VAR MaxWeekNumCreate =
    SUMX(
        FILTER(
            FilteredTable,
            'DemandSummaryAPS'[Week Num Create] = _max_week_num
        ),
        'DemandSummaryAPS'[quantity]
    )
       
VAR MinWeekNumCreate =
    SUMX(
        FILTER(
            FilteredTable,
            'DemandSummaryAPS'[Week Num Create] = _min_week_num
        ),
        'DemandSummaryAPS'[quantity]
    )
VAR _Week_By_Week =
    IF(
        _max_demand_id = _min_demand_id,
        MaxWeekNumCreate - MinWeekNumCreate
    )


VAR SUM_Week_By_Week =
    SWITCH(
        'DemandSummaryAPS'[Check Measure],
        1, _Week_By_Week,
        2, MaxWeekNumCreate,
        3, -MinWeekNumCreate,
        0  // Default case, you can adjust this based on your requirement
    )


RETURN
    SUM_Week_By_Week
1 REPLY 1
lbendlin
Super User
Super User

Think like the Grand Total. Use SUMMARIZE or SUMMARIZECOLUMNS, even for the individual rows.

 

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

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.

Top Solution Authors