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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors