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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. 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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.