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

How to perform a function only for a unique value from a column

Hi, i would like to get values ​​only for unique values ​​in the column in Power BI.

 

This is an example of my current table, in the backlog I used the function: 

'Backlog = IF([REALDATE] <> BLANK(),NETWORKDAYS([REALDATE],[PLANNEDDATE]),BLANK())'
NUMBERPLANNEDDATEREALDATEBACKLOG
123404.07.2211.07.22-6
123404.07.2211.07.22-6
000004.07.2214.07.22-9
999904.07.2208.07.22-5
999904.07.2208.07.22-5
999904.07.2208.07.22-5

 

and I would like to achieve something like this

 

NUMBERPLANNEDDATEREALDATEBACKLOG
123404.07.2211.07.22-6
123404.07.2211.07.22 
000004.07.2214.07.22-9
999904.07.2208.07.22-5
999904.07.2208.07.22 
999904.07.2208.07.22 

 

if the number repeats, I don't want to count the backlog for it. 

How i can do it? 

2 ACCEPTED SOLUTIONS
karen578
Helper I
Helper I

You could add an index column that restarts with each new NUMBER, and then add a new column with your formula conditional on the index.

 

See Create Row Number for Each Group in Power BI using Power Query - RADACAD.

Steps would include grouping by NUMBER, keeping all rows, adding an index column, then expanding.

 

Then you could just add your column with the Custom Formula option in the UI.

View solution in original post

serpiva64
Solution Sage
Solution Sage

Hi,

i was working on the same schema as karen578

this is the transformations in power query

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQyNlHSUTIw0TMw1zMyAjINDeFMXTOlWB3i1BgAAZoaBFPXEqzGEghQ1RhYINSYUk9NLAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [NUMBER = _t, PLANNEDDATE = _t, REALDATE = _t, BACKLOG = _t]),
#"Grouped Rows" = Table.Group(Source, {"NUMBER"}, {{"AllRows", each _, type table [NUMBER=nullable text, PLANNEDDATE=nullable text, REALDATE=nullable text, BACKLOG=nullable text]}}),
#"Added Custom" = Table.AddColumn(#"Grouped Rows", "Custom", each Table.AddIndexColumn([AllRows],"Index",1,1)),
#"Removed Other Columns" = Table.SelectColumns(#"Added Custom",{"Custom"}),
#"Expanded Custom" = Table.ExpandTableColumn(#"Removed Other Columns", "Custom", {"NUMBER", "PLANNEDDATE", "REALDATE", "BACKLOG", "Index"}, {"NUMBER", "PLANNEDDATE", "REALDATE", "BACKLOG", "Index"}),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded Custom",{{"NUMBER", type text}, {"PLANNEDDATE", type date}, {"REALDATE", type date}, {"BACKLOG", Int64.Type}, {"Index", Int64.Type}})
in
#"Changed Type"

and finally the dax

Column =
if('Table'[Index]=1, 'Table'[BACKLOG])
If this post is useful to help you to solve your issue, consider giving the post a thumbs up and accepting it as a solution !

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Thank You @karen578 and @serpiva64 for help 🙂

serpiva64
Solution Sage
Solution Sage

Hi,

i was working on the same schema as karen578

this is the transformations in power query

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQyNlHSUTIw0TMw1zMyAjINDeFMXTOlWB3i1BgAAZoaBFPXEqzGEghQ1RhYINSYUk9NLAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [NUMBER = _t, PLANNEDDATE = _t, REALDATE = _t, BACKLOG = _t]),
#"Grouped Rows" = Table.Group(Source, {"NUMBER"}, {{"AllRows", each _, type table [NUMBER=nullable text, PLANNEDDATE=nullable text, REALDATE=nullable text, BACKLOG=nullable text]}}),
#"Added Custom" = Table.AddColumn(#"Grouped Rows", "Custom", each Table.AddIndexColumn([AllRows],"Index",1,1)),
#"Removed Other Columns" = Table.SelectColumns(#"Added Custom",{"Custom"}),
#"Expanded Custom" = Table.ExpandTableColumn(#"Removed Other Columns", "Custom", {"NUMBER", "PLANNEDDATE", "REALDATE", "BACKLOG", "Index"}, {"NUMBER", "PLANNEDDATE", "REALDATE", "BACKLOG", "Index"}),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded Custom",{{"NUMBER", type text}, {"PLANNEDDATE", type date}, {"REALDATE", type date}, {"BACKLOG", Int64.Type}, {"Index", Int64.Type}})
in
#"Changed Type"

and finally the dax

Column =
if('Table'[Index]=1, 'Table'[BACKLOG])
If this post is useful to help you to solve your issue, consider giving the post a thumbs up and accepting it as a solution !
karen578
Helper I
Helper I

You could add an index column that restarts with each new NUMBER, and then add a new column with your formula conditional on the index.

 

See Create Row Number for Each Group in Power BI using Power Query - RADACAD.

Steps would include grouping by NUMBER, keeping all rows, adding an index column, then expanding.

 

Then you could just add your column with the Custom Formula option in the UI.

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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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 Kudoed Authors