Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Power BI Weekly report

Hello community experts,

 

Need to calculate the weekly target reports (we have a measure for monthly targets) where the logic for weeks that are in common between 2 months should be: Week should share the target of the month which more days are in common.

Example: WK 13 should have March target (4 days vs 3 days)

 

 

Please help. 

 

Thank you. 

 

Regards,

Anirban

 

 

3 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for your blog, Amit.

       

      But the daily target has already been implemented, I am looking for the weekly targets with the logic mentioned in my original post. Can you please help me on that thing? Thanks again. 

      • amitchandak's avatar
        amitchandak
        Super User

        Anonymous , You can simply use this week vs last week kind of measures


        new columns

        Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date],1)+1
        Week End date = 'Date'[Date]+ 7-1*WEEKDAY('Date'[Date],1)

         

        Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)

         

        measures
        This Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
        Last Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))

         

        See if this can help