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 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
Super User
Super User

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
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.