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
jwesle
Frequent Visitor

Help Request - Track Line Status Changes by Date

Hello,

 

I'm new to PowerBI and struggling to create code to track productivity. Below is an example of the data I am working with:

 

NameProductKeyReport DateNote
JimSilver111/14/20180
JimSilver111/15/20180
JimSilver111/16/20181
JimSilver111/17/20181
JimSilver211/15/20180
JimSilver211/16/20181
JimGold111/14/20181
JimGold111/15/20181
JimGold111/16/20181
JimGold211/15/20181
JaneBronze111/15/20181
JaneBronze111/16/20181
JaneBronze211/14/20180
JaneBronze211/15/20181
JaneBronze211/16/20181
JaneTin111/15/20180
JaneTin111/16/20181
JaneTin211/16/20180

 

Here's the situation: We are trying to calculate the number of times an individual changes the status of a line each day. When an individual completes a task, the "Note" column will change from 0 to 1. The line may be on the report for several days before and/or after the task is completed, which makes it difficult to count when the work is actually completed. For the above example, the ideal output would be the table below:

 

 11/14/201811/15/201811/16/201811/17/2018
Jim1120
Jane0210

 

Any thoughts?  Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @jwesle,

 

You can try to use following calculated column formula to replace note column, then drag this one to matrix visual value field with summary mode 'sum'.

Replaced = 
IF (
    COUNTROWS (
        FILTER (
            Table,
            [Name] = EARLIER ( [Name] )
                && [ProductKey] = EARLIER ( Table[ProductKey] )
                && [Report Date] < EARLIER ( Table[Report Date] )
                && [Note] = 1
        )
    )
        > 0,
    0,
    [Note]
)+0

21.PNG

 

Regards,

Xiaoxin Sheng

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @jwesle,

 

You can try to use following calculated column formula to replace note column, then drag this one to matrix visual value field with summary mode 'sum'.

Replaced = 
IF (
    COUNTROWS (
        FILTER (
            Table,
            [Name] = EARLIER ( [Name] )
                && [ProductKey] = EARLIER ( Table[ProductKey] )
                && [Report Date] < EARLIER ( Table[Report Date] )
                && [Note] = 1
        )
    )
        > 0,
    0,
    [Note]
)+0

21.PNG

 

Regards,

Xiaoxin Sheng

Greg_Deckler
Community Champion
Community Champion

I would add a column and use EARLIER to return a zero or 1 for whether an item was completed on a particular row. See my article on Mean Time Before Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/3395...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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