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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Assign value at after group by

Hi All,

 

Is there a way to assign a value after group by 

I have a child code which is indicated with a flag 'Y' or 'N'.

Child codes are associated with parent codes what I am trying to achieve is 

create a new column or measure at parent code level

Even one child code has flag Y then assign Y to the whole parent code

I created following and its working fine until when I select different dates the new column is not considering date slicer.

 

Has C_Flag = var __Parent = 'Table'[Parent Code]
var __max = maxx(FILTER(ALL('Table'), 'Table'[Parent Code] = __Parent),[C_Flag Measure])
return
IF(__max = 1,"Y","N")
 
Can some one please suggest Thank you
2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Create a meausre

 

 

Has C_Flag = var __Parent = max('Table'[Parent Code])
var __max = maxx(FILTER(ALLselected('Table'), 'Table'[Parent Code] = __Parent),[C_Flag Measure])
return
IF(__max = 1,"Y","N")

 

or

 

Has C_Flag = var __Parent = max('Table'[Parent Code])
var __max = maxx(FILTER(ALL('Table'), 'Table'[Parent Code] = __Parent),[C_Flag Measure])
return
IF(__max = 1,"Y","N")

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thank you @amitchandak 

Sure I will try and will let you know the result.

quick question I wanted the column to be used as slicer since we are creating a measure I think it wont allow us to use as slicer Y and N as inputs.

 

Any suggetion on that will be really helpful

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

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.

Top Solution Authors
Top Kudoed Authors