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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Grouping in Power Query

Dear all,

Can anyone explain of how to group rows in Power Query based on whether all proper cells in column "Date" contain value or not.

Example with some more information below.

Urmas_0-1643728097954.png

Thanks in advance,

Urmas

1 ACCEPTED SOLUTION

  1. Add an Index column
  2. Add a custom column with a formula similar to:  =if [Date] <> null then [Index] else null
    1. If the blank dates are not "null", you may need a different comparison:  eg [Date] <>""
  3. Fill down the custom column
  4. Group by {"Account no.","Entry number","Custom"}
  5. Then you can add a custom aggregation of a concatenated "Explanation"

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Thank you. Solution works perfectly:

Regards,

 

Urmas

AlexisOlson
Super User
Super User

So you want to remove the rows where [Entry number] starts with "TA" in this example?

Anonymous
Not applicable

I would like to achieve following:

 

Current situation:

Entry noDateDescription
TA 320.02.2017

Ettemaks Algsaldo Maksude

TA 3 

ettemaksukonto (31.12.2016) Maksu- ja

TA 3 

Tolliamet

Final situation:

Entry noDateDescription
TA 3 20.02.2017Ettemaks Algsaldo Maksude ettemaksukonto (31.12.2016) Maksu- ja Tolliamet

 

In other words to merge rows with similar Entry no in order to have the description in one cell but only in cases where the date is missing in respective cells. If there is date in all respective cells it is different description and should not be merged.

 

I hope it added some clarity.

 

Regards,

 

Urmas

  1. Add an Index column
  2. Add a custom column with a formula similar to:  =if [Date] <> null then [Index] else null
    1. If the blank dates are not "null", you may need a different comparison:  eg [Date] <>""
  3. Fill down the custom column
  4. Group by {"Account no.","Entry number","Custom"}
  5. Then you can add a custom aggregation of a concatenated "Explanation"

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.