Solved

calculate total between start date and last day of current month - DAX (power pivot)

Posted on 2016-09-08
4
67 Views
Last Modified: 2016-09-08
I have a traditional sales entries table with balances, due dates etc.

I want to calculate the total balance due between a given start start (e.g 1900) and the last day of the current month.

I know I could use the dates between function like below, however I would need to alter the range every month.

 DATESBETWEEN(DateTime[DateKey],  
    DATE(2007,6,1),  
    DATE(2007,8,31)  
  ))  

How would I change the end date (bold) so that it always refers to the last day of the current month.

Mike
0
Comment
Question by:mikes6058
  • 2
  • 2
4 Comments
 
LVL 49

Expert Comment

by:Rgonzo1971
ID: 41789486
Hi,

maybe

EOMONTH(TODAY(),0)

Regards
0
 

Author Comment

by:mikes6058
ID: 41789535
Hasn't worked for me but I may not be using the corrent syntax

Could you rewrite the formula below.

=CALCULATE('CLE with remaining balances'[Sum of Rem. Amount],DATESBETWEEN('CLE with remaining balances'[Due Date],date(2000,01,01),DATE(2016,09,30)))
0
 
LVL 49

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 41789544
then try

=CALCULATE('CLE with remaining balances'[Sum of Rem. Amount],DATESBETWEEN('CLE with remaining balances'[Due Date],date(2000,01,01),EOMONTH(TODAY(),0)))
1
 

Author Closing Comment

by:mikes6058
ID: 41789606
Brilliant!

Thanks
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now