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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Anonymous
Not applicable

Keeping null values in aggregation table

I"m working on a report to identify if resources have been committed correctly to various projects. The demand hours, commit hours, and constrained hours (gap hours) are on three different rows in the data set and I'm trying to consolidation all of them to 1 row. I created a Y\N flag to identify if the value in the committed column is either 0 or null. the data set looks like this:

 

WorkCategoryValueProject NameIDResourceRoleValueResourceNameIdTaskDetailTier34OrgIdMonthCatHoursDateDemand HrsCommit HrsBlankCommitFlag
Project35Electrical Engineer 2 TTS Analyst11AugGap488/1/202000N
Project35Electrical Engineer 2 TTS Analyst11Aug 488/1/2020480N
Project35Electrical Engineer 2 TTS Analyst11AugCommit 8/1/20200 Y

 

 

           

 

I aggregated the data set, but I'm generating two rows where there should be only one, it appears as follows:

WorkCategoryValueProjectNameIdResourceRoleValueResourceNameIdTaskDetailDateBlankCommitFlagDemand HrsCommit Hrs
Project35Electrical Engineer 2 TTS Analyst8/1/2020N480
Project35Electrical Engineer 2 TTS Analyst8/1/2020Y0 

 

I'm trying to find a way to replace the 0 values with null so I can consolidate the aggregated table into 1 row. I'm not sure how to do this and could use some help, 

 

ixdutt

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous 

I build the same table as yours to have a test.

1.png

Just like mwegener replied before you when you summarize ,you dont need to add the BlankCommitFlag.

I build Measure to achieve your goal.

'AGG_REsource Request =

VAR _MAXDH =

    MAXX (

        FILTER (

            ALL ( 'Table' ),

            'Table'[Project NameID] = MAX ( 'Table'[Project NameID] )

        ),

        'Table'[Demand Hrs]

    )

VAR _MAXGH =

    MAXX (

        FILTER (

            ALL ( 'Table' ),

            'Table'[Project NameID] = MAX ( 'Table'[Project NameID] )

        ),

        'Table'[Gap Hours]

    )

VAR _MAXCS =

    MAXX (

        FILTER (

            ALL ( 'Table' ),

            'Table'[Project NameID] = MAX ( 'Table'[Project NameID] )

        ),

        'Table'[Commit Hrs]

    )

RETURN

    SUMMARIZE (

        'Table',

        [WorkCategoryValue],

        [Project NameID],

        'Table'[ResourceRoleValue],

        'Table'[ResourceNameId],

        'Table'[TaskDetail],

        'Table'[Date],

        "Demand Hrs", _MAXDH,

        "Gap Hours", _MAXGH,

        "Commit Hrs", _MAXCS

    )

Result:

2.png

You can download the pbix file from this link: Keeping null values in aggregation table

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

 

Best Regards,

Rico Zhou

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @Anonymous 

I build the same table as yours to have a test.

1.png

Just like mwegener replied before you when you summarize ,you dont need to add the BlankCommitFlag.

I build Measure to achieve your goal.

'AGG_REsource Request =

VAR _MAXDH =

    MAXX (

        FILTER (

            ALL ( 'Table' ),

            'Table'[Project NameID] = MAX ( 'Table'[Project NameID] )

        ),

        'Table'[Demand Hrs]

    )

VAR _MAXGH =

    MAXX (

        FILTER (

            ALL ( 'Table' ),

            'Table'[Project NameID] = MAX ( 'Table'[Project NameID] )

        ),

        'Table'[Gap Hours]

    )

VAR _MAXCS =

    MAXX (

        FILTER (

            ALL ( 'Table' ),

            'Table'[Project NameID] = MAX ( 'Table'[Project NameID] )

        ),

        'Table'[Commit Hrs]

    )

RETURN

    SUMMARIZE (

        'Table',

        [WorkCategoryValue],

        [Project NameID],

        'Table'[ResourceRoleValue],

        'Table'[ResourceNameId],

        'Table'[TaskDetail],

        'Table'[Date],

        "Demand Hrs", _MAXDH,

        "Gap Hours", _MAXGH,

        "Commit Hrs", _MAXCS

    )

Result:

2.png

You can download the pbix file from this link: Keeping null values in aggregation table

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

 

Best Regards,

Rico Zhou

mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Anonymous,

 

how you aggregated the data?

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Anonymous
Not applicable

mwegener, 

 

I first added the following column to the source data set to identify null values in the data set (I realize that null values are replaced by 0 values in aggregation tables):

BlankCommitFlag = IF(ISBLANK([Commit Hours]), "Y", "N"

 

Then in the Data View, Modelling > Create Table

 

'AGG_REsource Request = SUMMARIZE('FACT_ResourceRequestList',[WorkCategoryValue],[ProjectNameId],[Tier34OrgId],' etc. to build out the aggregated table. 

 

I hope that helps, 

 

ixdutt

mwegener
Most Valuable Professional
Most Valuable Professional

Hi @Anonymous 

 

do not include the column BlankCommitFlag in your SUMMARIZE

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


amitchandak
Super User
Super User

@Anonymous , it not coming in one row because of CommitFlag, it has value Y and N. Take Max for that?

 

Typically Numbers has default aggregation as a sum. That should add up to one row.  Or use some aggregation for Demand Hrs ,Commit Hrs

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Amit, 

 

Thanks for your reply, but does the MAX() function apply to Y\N values in a column? I thought the function only applies to numeric values only. 

 

ixdutt

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.