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

Group by multiple columns, then fill up/fill down

I have merged two datasets by a common client ID number, the "MIS ID" column.  One dataset includes the MIS ID, FNPI, Served (MIS) and Achieved (MIS) columns.  The other dataset includes the MIS ID, ChildPlus Family ID, FNPI, Served (ChildPlus) and Achieved (ChildPlus) columns.  I am trying to group by the MIS ID, ChildPlus Family ID, and FNPI columns, then fill up/down by the Achieved (MIS) column.  I need to group by both the MIS ID and ChildPlus Family ID columns because not every client has both - some just have an MIS ID, some just have a ChildPlus ID and some have both - so that will help me sort out the "nulls" when I try to fill up/down.  At least I think it will!

 

Here's my problem.  When I try to add FillUp/FillDown then it does not fill correctly.  In the example below, in the preview table, MIS ID 12230762 should have "null" in the Achieved (MIS) column.  Instead it appears to have filled down from the previous row, which is the same MIS ID and ChildPlus ID but different FNPI.

 

Here's what I've got:

 

= Table.Group(#"Filtered Rows", {"MIS ID", "ChildPlus Family ID", "FNPI"}, {{"Custom", each Table.FillUp(Table.FillDown(_, {"Achieved (MIS)"}),{"Achieved (MIS)"}), type table [FNPI=nullable text, Member Name=nullable text, MIS ID=nullable number, ChildPlus Family ID=nullable number, Do not enter into MIS=nullable text, #"Served (ChildPlus)"=nullable number, #"Achieved (ChildPlus)"=nullable number, #"Served (MIS)"=nullable number, #"Achieved (MIS)"=nullable number, Case Worker=nullable text]}})

 

snap.png

 

My final goal is to have a conditional column that shows Served (All Databases) and Achieved (All Databases) where if the FNPI is achieved in either MIS or ChildPlus, then it counts as Achieved.  I think I have the rest of it worked out but am having issues with the GroupBy and FillUp/Fill Down step filling correctly.

1 REPLY 1
Melodyv
Frequent Visitor

Still working on this one. I ended up merging the two ID columns before grouping.  After grouping with my fill up/fill down embedded, I expanded columns, removed all other columns, and then split my ID columns into two columns again.  Data seems to be pulling correctly.  However, that is only filling up/down one column - the MIS ID column.  I still need to be able to fill up/down the ChildPlus Family ID column, which is grouped.  When I try sorting & filling down, it yields an incorrect result.

For example, Row 4 should have a 1 in the "Achieved (ChildPlus)" column.  Row 18 and Row 20 should as well.  When I try fill up/down it fills the entire column with 1's.

 

Melodyv_2-1682099199571.png

 

 

 

 

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.