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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Average DAX function

Hi.

 

Can somebody please help me with a DAX function for the average days of inventory that does not take time into account? I have set my table to show me the last 12 months but I want to include the average days before the 12 months. So it should somehow accumulate the days 🙂 

Hope it makes sense. 

 

lavmads_0-1674637017149.png

 

Best regards,

Lisa 

 

 

3 REPLIES 3
Anonymous
Not applicable

@pratyashasamal 

No, I have over 10 years of data but have restricted it to 12 months. Also it is not sales numbers but it has to be calculated based on dates. I made this function but it is not working 🙂

VAR _dato = MAX(Kalender[Date])

RETURN

AVERAGEX(

    FILTER(Data,
    CALCULATE(
        ALL(Kalender),
        Data[Registreret dato] <_dato
        && OR(Data[Afsluttet dato] > _dato, ISBLANK(Data[Afsluttet dato]))
    )
    ),
    DATEDIFF(Data[Registreret dato],_dato,DAY)
)

Hi @Anonymous ,
Hope the suggestion us hepful . 
I had just provided some example so that you can related to it .
Thanks ,
Pratyasha Samal
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





pratyashasamal
Memorable Member
Memorable Member

Hi @Anonymous ,
You can use this type of dax calc :-
Average = AVERAGEX(ALL(Sales),Sales[TaxAmt])
Note :-
If you dataset has only 12 month of data (imported only 12 month of data) then average will be on top of 12 months of data . But if there more data imported by you have restricted for only the visual then ALL function can be used .
Thanks,
Pratyasha Samal
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.