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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sroy
New Member

backfill data by group - dax question

In powerpivot, I have a table have a flag by group only when the status is complete. There is only one flag per group currently. I want to back fill the flag for the whole group for each status. Below is a small example of the table that I have and the table that I want. How would i write this with dax?

 

here is the table that I have:

Group   Status                Flag
A           Pending 

A           Pending

A           Complete          Y

B           Started

B           Pending

B           Complete          B

C          Pending

C          Complete      

D          Complete         Y

E          Pending 

F          Complete

G         Started 

G         Complete         B      

 

here is the table I want

Group   Status                Flag
A           Pending            Y

A           Pending            Y

A           Complete         Y

B           Started             B

B           Pending           B

B           Complete         B

C          Pending

C          Complete

D          Complete         B

E           Pending

F           Complete

G          Started             B

G          Complete        B

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

HI @sroy

 

Try adding this calculated column

 

New Column =
CALCULATE (
    FIRSTNONBLANK ( Table1[Flag], 1 ),
    FILTER ( ALLEXCEPT ( Table1, Table1[Group] ), Table1[Status] = "Complete" )
)

Regards
Zubair

Please try my custom visuals

View solution in original post

4 REPLIES 4
Zubair_Muhammad
Community Champion
Community Champion

HI @sroy

 

Try adding this calculated column

 

New Column =
CALCULATE (
    FIRSTNONBLANK ( Table1[Flag], 1 ),
    FILTER ( ALLEXCEPT ( Table1, Table1[Group] ), Table1[Status] = "Complete" )
)

Regards
Zubair

Please try my custom visuals

Hi @Zubair_Muhammad This works! What if the label wasnt always in the complete row?

@sroy

 

In that case, simply Smiley Tongue

 

New Column =
CALCULATE (
    FIRSTNONBLANK ( Table1[Flag], 1 ),
    ALLEXCEPT ( Table1, Table1[Group] )
)

 

 

 


Regards
Zubair

Please try my custom visuals

Thank you!!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.