Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
cristianj
Helper IV
Helper IV

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
1 ACCEPTED SOLUTION
amitchandak
Super User
Super 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

View solution in original post

1 REPLY 1
amitchandak
Super User
Super 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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.