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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
dla005
Helper I
Helper I

Sum value based on Current Month

Hi,

 

I am trying build a Dax for starting inventory for the month(all open inventory from prior months). However, I cant seem to be able to create the dax for it.

 

So my goal is i want to capture all the received date that has a paid date and blank up to up to 1 month before the date on the date table (For example if the date table is May 20 then i want all th recieved date up to April)

 

I tried using this create column DAX: IF(Recieved date = Complete Date),0,1) however, in May it does not include claim 2 since the recieved date is in 202003 and the complete date is 202005. Is there a way around this? Thank you!!

 

 

Below is my fake data and the table i am tryihng to create.

 

Goal

 Date tableCount
Received dateMar-20 
Received dateApr-204
Received dateMay-205

 

Data

ClaimReceived dateComplete date AprMay
1202003202004 1 
2202003202005 11
3202003202003 0 
4202003  11
5202003202005 11
6202004202005 01
7202004  01
8202004202004 0 
9202005  00
10202005  00
11202005202005 00

 

 

 

2 REPLIES 2
parry2k
Super User
Super User

@dla005 As a best practice, add date dimension in your model and use it for and time intelligence calculations. Once the date dimension is added, mark it as a date table on table tools.

https://perytus.com/2020/05/22/create-a-basic-date-table-in-your-data-model-for-time-intelligence-ca...

 

and then use Openingbalancemonth DAX function.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Weird I think my message got deleted  while I was editing the table to make it look more readable.

 

@parry2k I made the 2 changes per your recommendation and i got really close to the answer. The result I got from the OpeningBalanceMonth(Opening BalanceMonth(Sumx(query1,query[value], date[Month])

 

Mar - 26,850

Apr - 24,147

May - 20,109

 

However, it does not account for prior month value that are still open. For example, May should be 22,106( 20,109+46+37+1,828 +46) and April should be 25,443 (24,147+1,233+46+37). Is there a way i can edit the DAX to account for the prior months that was not completed till later? Thank you so much for your help

 

  Complete date     
  <3/1/2020MarAprMayJunTotal
Date RecievedFeb025,5341,233463726,850
 Mar0022,2531,8284624,127
 Apr4090018,3391,36120,109
        

 

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors