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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
wlknsnBI
Helper II
Helper II

Power Query Custom/Conditional Grouping

Hi,

 

I'm trying to create a custom [Key] which is used to group items. It's a combination of:

* [Project]

* conditional total where if previous row [Concat] is not same as current row [Concat] add +1

 

PS: simple grouping of [Project] does not work, because you need to take into account Field 1 & Field 2, if it's filled, the next item should be +1.

 

ProjectField1Field2IndexConcatKey
A  1AA1
A  2AA1
A  3AA1
B  4BB1
B  5BB1
BX16BX1B1
B  7BB2
BY18BY1B2
C  9CC1
C  10CC1
D  11DD1
E  12EE1
E  13EE1
E  14EE1
2 REPLIES 2
v-eqin-msft
Community Support
Community Support

Hi @wlknsnBI ,

 

I have the same doubts as @lbendlin . As you said, as long as one of the following two conditions is met, add 1

  •  previous row [Concat] is not same as current row [Concat] 
  • Field1 and Field2 are not blank.

So according to my understanding, the row6 should be B2 , row7 =B3, row8=B4

 

Can you please share more detail information to help us clarify your scenario?

 

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

lbendlin
Super User
Super User

Why is BY1 not resulting in B3 ?

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.