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

Measure to show difference in attribute from past date to current

Hello,  

 

I have a dataset that lists out the value of 'Completed Work' on each day of the week for 'Work Item ID'.   I want to create a visualization that shows the difference in 'Completed Work' from the current date and 'Sunday' of the current week for each unique 'Work Item ID'.    I currently have the dataset filtered to show only one week's worth of Work Items, but ideally, I would be able to expand this to a monthly view and get a read out of work done on each item on a weekly basis for the whole month.  

 

 

 

Thanks in advance,

R.

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

Hi @Rotrox404

 

Please try this MEASURE

 

Difference from Sunday =
VAR CompletedWorkonSunday =
    CALCULATE (
        SUM ( Table1[Completed Work] ),
        FILTER (
            ALLEXCEPT ( Table1, Table1[Work Item Id] ),
            WEEKNUM ( Table1[Date] ) = WEEKNUM ( SELECTEDVALUE ( Table1[Date] ) )
                && WEEKDAY ( Table1[Date], 1 ) = 1
        )
    )
RETURN
    SUM ( Table1[Completed Work] ) - CompletedWorkonSunday

Regards
Zubair

Please try my custom visuals

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

Hi @Rotrox404

 

Please try this MEASURE

 

Difference from Sunday =
VAR CompletedWorkonSunday =
    CALCULATE (
        SUM ( Table1[Completed Work] ),
        FILTER (
            ALLEXCEPT ( Table1, Table1[Work Item Id] ),
            WEEKNUM ( Table1[Date] ) = WEEKNUM ( SELECTEDVALUE ( Table1[Date] ) )
                && WEEKDAY ( Table1[Date], 1 ) = 1
        )
    )
RETURN
    SUM ( Table1[Completed Work] ) - CompletedWorkonSunday

Regards
Zubair

Please try my custom visuals

Thanks, was able to use this to guide me towards the solution I needed!

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.