Skip to main content

I want the sum of sales to populate with Date Level Selector:

Want the bar graph to populate as per calendar/Month selected in order. Calendar Year, Fiscal Year, Month, Week, Day.The results populate right but are not in order. I am not able to do a sort by Month when month selected or even fiscal doesn't populate in order.

 

Below is the formula used:

CASE [Date Level Selector]

  WHEN 'Year' THEN STR(YEAR([Date]))

  WHEN 'Fiscal Year' THEN 

    IF MONTH([Date]) >= 9 THEN 

      "FY " + STR(YEAR([Date]) + 1)

    ELSE 

      "FY " + STR(YEAR([Date]))

    END 

 WHEN 'Month' THEN 

    DATENAME('month',[Date]) + " " + STR(YEAR([Date])) 

  WHEN 'Day' THEN 

    // Format Date as MM/DD/YY

    RIGHT("00" + STR(MONTH([Date])), 2) + "/" + 

    RIGHT("00" + STR(DAY([Date])), 2) + "/" + 

    RIGHT(STR(YEAR([Date])), 2)  

WHEN 'Week' THEN 

    RIGHT("00" + STR(MONTH(DATETRUNC('week', [Date]))), 2) + "/" + 

    RIGHT("00" + STR(DAY(DATETRUNC('week', [Date]))), 2) + "/" + 

    RIGHT(STR(YEAR(DATETRUNC('week', [Date]))), 2)  

END  

 

image 

1 Antwort
0/9000