Forum Discussion

vengadesh_p's avatar
vengadesh_p
Icon for Helper II rankHelper II
3 years ago
Solved

YOY % changes for Star product

Hi All,

 

I have data like below table, i want to Create Star Product YOY changes %  

 

ProductSalesIs Star?MMM-YY
AC1000 1-Jan-2020
AC2200 1-Jan-2021
AC2700Y1-Jan-2022
AD100 1-Jan-2020
AD200 1-Jan-2021
AD300N1-Jan-2022
Washing Machine1500 1-Jan-2020
Washing Machine2000 1-Jan-2021
Washing Machine2500Y1-Jan-2022

 

 

Example : i did not filtred star product, so showing result was correct 

when i try to filter "Y" in is_star?  filter, it showing blank value  

expected value is (only AC, Washing Machine is star product)

i want to show YOY % only for is_star = "Y" but, this "Y" was present in 2022 record for this reson it shows blank value

 

Pls help me to resolve this logic

 

 

Sales = sum('Table'[Sales.])


Sales_PY = CALCULATE ( [Sales], DATEADD ( 'Dim_Calendar'[Date], -1, YEAR ) )


%YOY = DIVIDE([Sales]-[Sales_PY],[Sales_PY])

 

 

Thanks

Vengadesh p

 

 

  • Hi, vengadesh_p 

    Please add a new calculated column:

    IsStar = CALCULATE(MAX('Table'[Is Star?]),ALLEXCEPT('Table','Table'[Product]))

     

    Then replace your original field 'Is Star?' with this field  [Is Star] in the slicer to filter the data.

    Result:

    Best Regards,
    Community Support Team _ Eason

     

1 Reply

  • v-easonf-msft's avatar
    v-easonf-msft
    Icon for Community Support rankCommunity Support

    Hi, vengadesh_p 

    Please add a new calculated column:

    IsStar = CALCULATE(MAX('Table'[Is Star?]),ALLEXCEPT('Table','Table'[Product]))

     

    Then replace your original field 'Is Star?' with this field  [Is Star] in the slicer to filter the data.

    Result:

    Best Regards,
    Community Support Team _ Eason