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

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

Reply
MillarJayakumar
Frequent Visitor

power dax

Not getting desire output for 12 month rolling average calcuation. any one assist me why i am not getting expected 12 MRA out put

 

Dax code :

 

12mra final =
 var nmonth =12
 var LCDate =max('DMADP OPEM_ADP_DATE_D'[Date])
 var Period =DATESINPERIOD('DMADP OPEM_ADP_DATE_D'[Date],LCDate,-nmonth,MONTH)
 Var result =
 CALCULATE(
 AVERAGEX(VALUES('DMADP OPEM_ADP_DATE_D'[Year Month]),[TRs Count]),Period)
 return
 if([TRs Count]>0,result)
 
MillarJayakumar_0-1704910657796.png

 

3 REPLIES 3
aj1973
Community Champion
Community Champion

Hi @MillarJayakumar 

Did you add a Date Table to your Model? DATESINPERIOD() is a Time Intelligence function that needs a Date Table without gaps.

Besides in your graph seems like you are using Year-Month in the X Axis while in your measure you are using 

[Year Month] with no dash!

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

MillarJayakumar_0-1704939771751.png

1)it has a relationship 

2)DATESINPERIOD() is a Time Intelligence function that needs a Date Table without gaps-then its show error right while creating. but its not showing any error

3)Year-Month in the X Axis while in your measure you are using 

[Year Month] with no dash!- corrected everthough it not working 

Can you share a Sample please?

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.