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
Anonymous
Not applicable

average x -13 months

Hello All, 

 

I need to create a combined graph with as target line the average count of one field per month:
I have 2 columns DATA,ID_VENDITA

The graph must have as x=MONTH(DATA) value of the graph=COUNT(ID_VENDITA) and VALUES ROW=AVERAGE(COUNT(ID_VENDITA) by MONTH of the previous -13 months

 

example in December as row value i should have the avg of the count(id_vendita) of the previous 13 months since November 2020 to October 2019

 

How can i do it? thank you very much

 

 

 

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , try with a date table

Example

Rolling 13 = CALCULATE(Average(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],ENDOFMONTH(Sales[Sales Date]),-13,MONTH))
Rolling 13 = CALCULATE(Average(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX(Sales[Sales Date]),-13,MONTH))

 

Rolling 13 till last month = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],ENDOFMONTH(dateadd(Sales[Sales Date],-1,month)),-13,MONTH))

 

Rolling 13 = CALCULATE(Average(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],EOMONTH(MAX(Sales[Sales Date])-1),-13,MONTH))

Anonymous
Not applicable

@amitchandak 

 

Thanks for the answear maybe my question was not really close to the necessity.

i try to explain better: in my file i have the following column:

DATE_OF_SALES   |  ID_SHIPMENT

what i need is to calculate the Average for every month about the avg( of the count of the ID_SHIPMENT performed in the previous .

i need to have it : consider one thing the count of the ID_RICHIESTA/month doesn't exist in the data.

 

MeseConteggio di [ID_RICHIESTA]avg previous 13 months 
gennaio28482848
febbraio28702848
marzo25632859
aprile21922760
maggio28802618
giugno88872671
luglio37923707
agosto88733719
settembre14404363
ottobre15824038
novembre13343793
dicembre11403569
Anonymous
Not applicable

 

@amitchandak 

 maybe thw question is differen, i need to have the average of the previous 13 month since today .

 

The average need to be calculate based on the count of the column ID (ID column is a text column)

the goal is to answer at the question: what is the average of the number of intervent done in the previous 13 month since today?

How can i do it? 

thank you very much 

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.

Top Solution Authors