Forum Discussion

Venussuda's avatar
Venussuda
Frequent Visitor
5 years ago

Previousmonth Dax

Hi , 

I must have done something wrong. date filter may be 
I would like to compare overtime outstanding openingbalance , endofbalance every month

My DAX is below : 

EndofPrevmonth =
CALCULATE(SUMX('Tíarkontur 24 01 2021','Tíarkontur 24 01 2021'[Total Balance]),FILTER(ALL('Tíarkontur 24 01 2021'),SUMX(FILTER('Tíarkontur 24 01 2021',EARLIER('Tíarkontur 24 01 2021'[Date]) = LASTDATE(PREVIOUSMONTH('Tíarkontur 24 01 2021'[Date]))),[Total Balance])))
 
Total Balance = [Normal Time]+[Overtime 50 %]+[Overtime 100 %]+[Unnormal Hour]
Netchange = [Total Balance]-[EndofPrevmonth]
 
The total pr month pr department is correct,  but pr. person is incorrect, It´s showing the same no. which is a total pr. month actually.... why is that? what have I done wrong? how to fix it
Thanks in advance.
 
 

2 Replies

  • v-henryk-mstf's avatar
    v-henryk-mstf
    Icon for Community Support rankCommunity Support

    Hi Venussuda ,


    Maybe the reason for this error is the incorrect use of the FILTER function in the created EndofPrevmonth measure. You may wish to change the judgment condition after the filter function, and then see if the result has changed.


    If the problem is still not resolved, you need to provide specific data model or test data, otherwise I may not be able to help you do further testing. Looking forward to your reply.


    Best Regards,
    Henry


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