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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
JanoLehocky
Helper I
Helper I

Help with GroupKind.Local MCode

Overview of Issue

I am trying to identify sequencial strings of dates that contain dates that are flagged as A/AType = MUA.

 

The current code that I have is not grouping correctly and I am not understanding why.

 

Example of Output

JanoLehocky_0-1665616151858.png

 

The code which I will share next is looking at the following data:

JanoLehocky_1-1665616334773.png

 

If the idea is to look for sequencial groupings of dates then in the example above the sequences would be:

 

March 1st to March 3 >> 3 days - with no MUAs in the sequence

March 12 to March 15 >> 4 days - with no MUAs in the sequence

May 1st to May 2nd >> 2 days - with a count of 2 MUAs in the sequence

 

Here is the code taht is grouping to provide the above table:

#"Grouped Rows" = Table.Group(#"Changed Type1", {"AbsentCode"}, {{"# of Days", each Table.RowCount(_), Int64.Type}, {"MUADaysPresent", each List.Max([#"AA Code - Selections with MUA"]), type logical}, {"Start Date",
each List.Min([#"Start Date A/A Type"]), type nullable date}, {"End Date",
each List.Max([#"Start Date A/A Type"]), type nullable date}, {"Details",
each _, type table [Org. Text=nullable text, WS rule=nullable text, #"Pers.No."=nullable number, Name of Employee=text, First Working Date=date, Permanent Start Date=date, #"Start Date A/A Type"=nullable date, #"A/AType"=nullable text, #"Absence/Attendance hours"=nullable number, Planned working hours=nullable number, Rec. Order=any, Rec.WBS el=any, Cost Centre=number, Name=nullable text, Department=any, Chit Work Area=any, Send. CCtr=any, ActTyp=any, Activity=any, Rec. CCtr=any, Network=any, OC=any, PS group=any, Lv=any, #"Prem. no."=any, ID=any, Created on=nullable number, Time=nullable number, Created by=text, Last chnge=date, Time2=datetime, Changed by=text, Short Text=any, L=any, Rg=any, Delay=any, OT Rsn=any, OT Rsn Desc=any, Reason=any, OpAc=any, Sub Operation=any, Reason Code Desc=any, AbsentCode=text, #"AA Code - Selections with MUA"=logical]}}, GroupKind.Local),

 

Any advice would be greatly appreciated to set me on the right path.

 

Thank you,

Jano

 

 

2 REPLIES 2
JanoLehocky
Helper I
Helper I

Thanks to @v-zhangti  for pointing out that more clarity on the desired output is required.

 

I have a spreadsheet here that has more details

https://docs.google.com/spreadsheets/d/1tTzzK0oDWJb9Aqwf5QPjJ7GEFBPRTeIH/edit?usp=sharing&ouid=10053...

 

 

v-zhangti
Community Support
Community Support

Hi, @JanoLehocky 

 

I couldn't finish understanding. Based on your example data, what would you expect the output to look like? You can show it in Excel.

vzhangti_0-1665650588716.png

Employee names can be expressed using employee ID1, 2, 3.

 

Best Regards,

Community Support Team _Charlotte

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.