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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Spencer
Helper II
Helper II

Summarize Columns - Keeping blank rows

Hi, and apologies in advance if I'm missing something really simple. (Just haven't been able to find a solution elsewhere).

 

I'm creating a new table by using the SUMMARIZECOLUMNS function and am aiming to attain the number of employees joined per month. Some months have no new employees but I need the new table to still display an empty blank row for that month when this is the case.

I have been able to use the function below successfully, only without the blank rows displaying.

 

MonthlyJoined = SUMMARIZECOLUMNS('Employee Master'[MonthJoined],"Starters",COUNTROWS('Employee Master'))

 

Any help greatly appreciated.

Pic 3.jpg

 

 

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

hi @Spencer

 

1. Create a Table with Months and related to Employee Master with Month Joined Column.

 

2. Create a new table with this Dax:

Monthly = SUMMARIZECOLUMNS(Months[Month];"Starters";If(COUNTROWS(RELATEDTABLE(Employee Master))>0;COUNTROWS(RELATEDTABLE(Employee Master));0))



Lima - Peru

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi lmf232s,

 

Velarde’s point seems well, but in summarizecolumns function, it has an option [ignore] to keep the blank rows.

 

Sample:

I create two tables, ‘Product’(ID,Name) and ‘Record’(ProductID,Amount).

 

‘Product’:

Capture.PNG

 

‘Record’:

 Capture2.PNG

Then use SUMMARIZECOLUMNS function create a total table:

Table= SUMMARIZECOLUMNS('Product'[Name],"Total",sum(Record[Amount]))

 

 Capture3.PNG

Add the ignore option to show all the record.

Table = SUMMARIZECOLUMNS('Product'[Name],"Total",IGNORE(sum(Record[Amount])))

 

 Capture4.PNG

I modified your formula and add the ignore option:

MonthlyJoined = SUMMARIZECOLUMNS('Employee Master'[MonthJoined],"Starters",IGNORE ( COUNTROWS('Employe​e Master')))

 

 

Reference:

SUMMARIZECOLUMNS Function (DAX)

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Vvelarde
Community Champion
Community Champion

hi @Spencer

 

1. Create a Table with Months and related to Employee Master with Month Joined Column.

 

2. Create a new table with this Dax:

Monthly = SUMMARIZECOLUMNS(Months[Month];"Starters";If(COUNTROWS(RELATEDTABLE(Employee Master))>0;COUNTROWS(RELATEDTABLE(Employee Master));0))



Lima - Peru

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.