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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.