Forum Discussion

diogobraga2's avatar
diogobraga2
Icon for Helper IV rankHelper IV
6 years ago
Solved

Need to show 'week number' without changing aggregation.

The goal is to show week number in the visualization next to the weekly Total Returning trend. However, when 'Date' is removed from the visual the Total Returning aggregation changes. See screenshots...
  • mahoneypat's avatar
    6 years ago

    The problem is the measure.  It evaluates if the min of the week is Sunday.  At the day level that returns just Sundays in the visual.  When just the Week is present, it is still true but it then uses all the days of that week in the calculation.  Please use this expression which gets same results whether Date is there or not.

     

    Total Returning W =
    VAR thismin =
    MIN ( 'Dates Adj'[Date] )
    RETURN
    IF (
    WEEKDAY ( MIN ( 'Dates Adj'[Date] ) ) = 1,
    CALCULATE ( SUM ( [COMMITMENTS] ), 'Dates Adj'[Date] = thismin )
    )

     

    If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

    Regards,

    Pat