Forum Discussion

Rajendrabobade's avatar
5 years ago

data showing on user selected month

Hi,

 

I need help , i am working on month multiple selection filter , when i select Jan i need to show only jan data , if i select Jan and feb then i get both month data sum  for  previous year.

same i need for current year as well.

 

 In short i need Comprison for currnet year vs last year  but using mulitiple month selcetion.

Please help me on this 

 

Kindly help me .

 

 

2 Replies

  • Rajendrabobade , Try with date table year behind the measure

     

    Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))

    or

    last year MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-12,MONTH)))

    last year MTD (complete) Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(ENDOFMONTH(dateadd('Date'[Date],-12,MONTH))))

     

    To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
    https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions

    Appreciate your Kudos.

     

    • Rajendrabobade's avatar
      Rajendrabobade
      Icon for Helper II rankHelper II

      Hi,

      Thkas for reply .

      I need multiple month selection and showing sales value in matrix for last year.

      like . in Month filter user choosing Jan then showing jan last year sales

      If user select month - Jan and Feb then showing last year sum of sale for Jan and feb month.

      kindly suggest base on financial year - last year calculation on chosing multiple month.

      Filter -jan and feb

      Value - Sum of Jan and feb

      100+100=200

      filter jan

      value - only jan

      jan value 100