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
Venussuda
Frequent Visitor

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.
 
Total hour.jpgEndofPrevmonth.jpg
 
2 REPLIES 2
v-henryk-mstf
Community Support
Community 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.

v-henryk-mstf_0-1614587432527.png


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.

amitchandak
Super User
Super User

@Venussuda , There are functions for opening balance and closing balance.

Can you check if those can help - Refer my videos

https://www.youtube.com/watch?v=yPQ9UV37LOU

https://www.youtube.com/watch?v=6lzYOXI5wfo

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.