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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
ilamoureuse
Regular Visitor

Only keep DateMax row if there is a DateMin row

Hi!

 

Following my previous post, I thought that my problem was solved but I didn't think about a case that breaks my vizualization. 

 

Here is a sample of my data :

Work Item Id Iteration Path Attribut Date Catégorie de statut
100 Sprint 1 DateMin 2023-04-01 Planned
100 Sprint 1 Date Max 2023-04-15 Planned
100 Sprint 2 Date Min 2023-04-16 Planned
100 Sprint 2 Date Max 2023-04-30 Closed
100 Sprint 3 Date Max 2023-05-01 Closed

 

I don't want the last row to appear because there is no "DateMin" for the Item 100 in sprint 3. The rule I would like to execute is something like :

For each Work Item Id 

  For each Iteration Path

    if Work Item Id.Attribut = "DateMin" row doesn't exist then filter out Work Item Id.Attribut = "DateMax" row

 

I would prefer a solution that can be done through Power Query interface rather than a formula, IF THAT'S POSSIBLE. It would allow me to explain the process better to my colleagues. 🙂

 

Thanks for your help!

 

1 ACCEPTED SOLUTION
ThxAlot
Super User
Super User

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQwUNJRCi4oyswrUTAEMl0SS1IVfDPzgEwjAyNjXQMTXQOQeEBOYl5eaopSrA5OTYkVSJoMTfFpMsJuk6EZcZpQbDI2wKfJGJsmU4ifnHPyi0F6YgE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Work Item Id" = _t, #"Iteration Path" = _t, Attribut = _t, Date = _t, #"Catégorie de statut" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Work Item Id", Int64.Type}, {"Iteration Path", type text}, {"Attribut", type text}, {"Date", type date}, {"Catégorie de statut", type text}}),

    Grouped = Table.Group(#"Changed Type", {"Work Item Id","Iteration Path"}, {"Grouped", each if List.NonNullCount(List.Difference({"Date Min","Date Max"},[Attribut]))>0 then null else _}),
    #"Selected Rows" = Table.SelectRows(Grouped, each not ([Grouped] is null)),
    #"Expanded Grouped" = Table.ExpandTableColumn(#"Selected Rows", "Grouped", {"Attribut", "Date", "Catégorie de statut"})
in
    #"Expanded Grouped"

ThxAlot_0-1682969707106.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



View solution in original post

2 REPLIES 2
ilamoureuse
Regular Visitor

It works ! Thanks a lot @ThxAlot 😁

ThxAlot
Super User
Super User

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQwUNJRCi4oyswrUTAEMl0SS1IVfDPzgEwjAyNjXQMTXQOQeEBOYl5eaopSrA5OTYkVSJoMTfFpMsJuk6EZcZpQbDI2wKfJGJsmU4ifnHPyi0F6YgE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Work Item Id" = _t, #"Iteration Path" = _t, Attribut = _t, Date = _t, #"Catégorie de statut" = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Work Item Id", Int64.Type}, {"Iteration Path", type text}, {"Attribut", type text}, {"Date", type date}, {"Catégorie de statut", type text}}),

    Grouped = Table.Group(#"Changed Type", {"Work Item Id","Iteration Path"}, {"Grouped", each if List.NonNullCount(List.Difference({"Date Min","Date Max"},[Attribut]))>0 then null else _}),
    #"Selected Rows" = Table.SelectRows(Grouped, each not ([Grouped] is null)),
    #"Expanded Grouped" = Table.ExpandTableColumn(#"Selected Rows", "Grouped", {"Attribut", "Date", "Catégorie de statut"})
in
    #"Expanded Grouped"

ThxAlot_0-1682969707106.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



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