Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Help on looking at Values on a row

I have a situation I would love help with.  Below is an example of my data on a small scale  Basically what I am looking for is to zero in on the last work day of the week so I can look at productivity.  I want to be able to slice the data by location, week, so on.  We all know there is a decline in the productivity for that last day of the week, but I want to uantify it and visualize it across multiple slicers.  My idea was to create a column that would help me identify the gap in dates greater than 1, but not sure.  Any idea how? 

 

WeekDayLocationEmployee

Production

11/2DetroitJohn452
11/3DetroitJohn400
11/4DetroitJohn420
11/5DetroitJohn250
21/9DetroitJohn450
21/10DetroitJohn420
21/11DetroitJohn450
21/12DetroitJohn262
     

2 Replies

  • Hi, Anonymous 

    Please correct me if I wrongly understood your quetion.

    Please check the below picture and the sample pbix file's link down below, whether it is what you are looking for.

     

     

    Productions Diff VS Last Day =
    VAR currentweek =
    MAX ( Production[Week] )
    VAR currentlocation =
    MAX ( Production[Location] )
    VAR currentemployee =
    MAX ( Production[Employee] )
    VAR currentday =
    MAX ( Production[Day] )
    VAR lastdayproduction =
    CALCULATE (
    LASTNONBLANKVALUE ( Production[Day], Production[Productions] ),
    FILTER (
    ALLSELECTED ( Production ),
    Production[Day] < currentday
    && Production[Week] = currentweek
    && Production[Location] = currentlocation
    && Production[Employee] = currentemployee
    )
    )
    RETURN
    IF (
    NOT ISBLANK ( lastdayproduction ),
    IF (
    ISFILTERED ( Production[Week] ),
    Production[Productions] - lastdayproduction
    )
    )

     

     

    https://www.dropbox.com/s/aw2x8c5nitnzdt0/timmay.pbix?dl=0 

     

    Hi, My name is Jihwan Kim.

     

    If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

     

    Linkedin: linkedin.com/in/jihwankim1975/

    Twitter: twitter.com/Jihwan_JHKIM

  • Anonymous 

     

    What do you really want to calculate? Do you want to calculate Production on the last day (existing in the table) of the week when you slice by Week or do you want to identify the gaps in the Day column, meaning you want to have a calculated column? It's not really clear what you want...