Forum Discussion

cristianj's avatar
cristianj
Helper IV
3 years ago
Solved

Need help with formula

Hello i have this 

modeldatecantmodelid  
model101.01.20221mod01  
model203.01.20222mod02  
model310.01.20224mod03  
model415.01.20222mod04  
model517.01.20221mod05  
model112.02.20224mod01  
model315.02.20222mod03  
model515.02.20225mod05  
model119.02.20221mod01  
model321.02.20222mod02  
      
      
Last 30 day starting from slicer selected value of 15.02.2022
      
modelTotal    
model14    
model20    
model32    
model42    
model56    

 

 

i write a formula for a measure 

Valoare vanzare per model =
var InceputPerioada=SELECTEDVALUE(buy_phone_details[Data comanda S])-10
var SfarsitPerioada=SELECTEDVALUE(buy_phone_details[Data comanda S])
return
    SUMX(filter(ALL(buy_phone_details)
        ,(buy_phone_details[Data Comanda S])>InceputPerioada&&buy_phone_details[Data comanda S]<=SfarsitPerioada)
        ,buy_phone_details[Buy Price €]
    )
but it shows me the data for all model, how can i made to show me for each model corespondig value?
Thank you
  • cristianj , Join the date of table with date of date table and try a measure like example

     

    Rolling 30 = CALCULATE(Average(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-30,DAY))

     

    refer, if needed

    Rolling Days Formula: https://youtu.be/cJVj5nhkKBw

1 Reply

  • cristianj , Join the date of table with date of date table and try a measure like example

     

    Rolling 30 = CALCULATE(Average(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-30,DAY))

     

    refer, if needed

    Rolling Days Formula: https://youtu.be/cJVj5nhkKBw