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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
markc2018
Regular Visitor

Caseload based on start and end date sliced by Month

Hi All. I'm trying to build a DAX expression that will compare the start date of workload with the end date and then show that as a case in operation per month. So if a case started in March 2017 and ended in Jan 2018, I want to show thi in a table split into month view. I need to be clear, I'm doing this in Excel with power pivot, but I think the DAX expression would be the same...?

 

I've created a test spreadsheet with the relevant data as the actual data model has masses of other data, so Colums in the test spreadsheet are, Referral Date (Start date), Discharge Date (End Date) and Project Name.

 

So I just want to show that "Project", lasted between the start and end date in a table carved up into months so I can see the workload each month... sounds easy...right?

4 REPLIES 4
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @markc2018,

Could you mean to compare two dates in different columns? If so, you could use the DATEDIFF function:

https://docs.microsoft.com/en-us/dax/datediff-function-dax

And if it could not help you solve your problem, could you please share some sample data and past your desire result if possible?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

This is what I need to output;

 

excel.PNG

 

Hi, so what I need to do is compare 3 dates, a start, a finnish to get the length of time the project is running for and then a third dtae that slices the data into a monthly caseload.

Just for some test data I created this basic table;

 

Name Referral Date Discharge Date

Mark17/02/2017 00:00:0009/08/2018 00:00:00
Stuart28/03/2017 00:00:0014/10/2017 00:00:00
David03/04/2017 00:00:0025/07/2018 00:00:00
John28/06/2017 00:00:0028/06/2017 00:00:00
Kelly04/01/2017 00:00:0004/01/2017 00:00:00
sSimon20/03/2018 00:00:0013/04/2018 00:00:00
Jack18/06/2018 00:00:0024/06/2018 00:00:00
Sally06/02/2018 00:00:0006/02/2018 00:00:00
Vicky12/06/2018 00:00:0013/06/2018 00:00:00
Ruth30/11/2017 00:00:0024/01/2018 00:00:00

 

 

Hi @markc2018,

Based on my test, I am afraid you could not get this feature currently. In Power BI, I am afraid it could not list month's names between two date columns automatically.

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.