Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

DAX Help

Please help guys

Days of Inventory in Hand (DIH) =  Average Inventory / Average daily Net Sales.

 

Now how to arrive average inventory:

 

From the selected date by user say 04.06.2020, go backward and check inventory value on 04.06.20, 04.05.20…………….. 04.07.19 (12 months)

Add all twelve months inventory and divide it by 12 so that you will get average inventory.

 

Average daily net sales =  say selected date 04.06.20 then ( Net sales from 04.07.19 to 04.06.20 (12 months) divide it by 12)                   

  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi Anonymous ,

     

    You will need a calendar table.

    CALENDAR = CALENDAR(MIN('Table'[date]),MAX('Table'[date]))
    
    Measure =
    CALCULATE (
        AVERAGE ( 'Table'[inventory] ),
        FILTER (
            'Table',
            'Table'[date] <= SELECTEDVALUE ( 'CALENDAR'[Date] )
                && 'Table'[date] >= EDATE ( SELECTEDVALUE ( 'CALENDAR'[Date] ), -12 )
        )
    )
        / CALCULATE (
            AVERAGE ( 'Table'[net sales] ),
            FILTER (
                'Table',
                'Table'[date] <= SELECTEDVALUE ( 'CALENDAR'[Date] )
                    && 'Table'[date] >= EDATE ( SELECTEDVALUE ( 'CALENDAR'[Date] ), -12 )
            )
        )
    

     

     

    Best Regards,

    Jay

     

    Community Support Team _ Jay Wang

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies