Forum Discussion
cristianj
3 years agoHelper IV
Need help with formula
Hello i have this
| model | date | cant | modelid | ||
| model1 | 01.01.2022 | 1 | mod01 | ||
| model2 | 03.01.2022 | 2 | mod02 | ||
| model3 | 10.01.2022 | 4 | mod03 | ||
| model4 | 15.01.2022 | 2 | mod04 | ||
| model5 | 17.01.2022 | 1 | mod05 | ||
| model1 | 12.02.2022 | 4 | mod01 | ||
| model3 | 15.02.2022 | 2 | mod03 | ||
| model5 | 15.02.2022 | 5 | mod05 | ||
| model1 | 19.02.2022 | 1 | mod01 | ||
| model3 | 21.02.2022 | 2 | mod02 | ||
| Last 30 day starting from slicer selected value of 15.02.2022 | |||||
| model | Total | ||||
| model1 | 4 | ||||
| model2 | 0 | ||||
| model3 | 2 | ||||
| model4 | 2 | ||||
| model5 | 6 |
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
- amitchandakSuper User
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