March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi, using the dog kennel table below, I'm looking for a column/measure that when the End date is blank, it gives me the last date of the month that we are currently in, and puts the number count in Numbe_of_Days_Open, please. Thanks!
Location | Kennel | Start Date | End Date | Number of Days |
Manchester | 1 | 01/04/2024 | 10/04/2024 | 10 |
Manchester | 1 | 01/06/2024 | 14/06/2024 | 14 |
Manchester | 1 | 28/11/2024 |
Solved! Go to Solution.
Hi @RichOB ,
Try below DAX to create a measure:
Thanks for the reply from AnkitaaMishra , please allow me to provide another insight:
Hi, @RichOB
AnkitaaMishra 's solution is a good idea for measures.Now, I will provide a solution for calculated columns:
1.Firstly, you need to create the following two calculated columns:
end1 =
IF ( ISBLANK ( 'Table'[End Date] ), EOMONTH ( TODAY (), 0 ), 'Table'[End Date] )
Number of Days1 =
IF (
ISBLANK ( 'Table'[End Date] ),
DATEDIFF ( 'Table'[Start Date], EOMONTH ( TODAY (), 0 ), DAY ) + 1,
DATEDIFF ( 'Table'[Start Date], 'Table'[End Date], DAY ) + 1
)
2.Here's my final result, which I hope meets your requirements.
Please find the attached pbix relevant to the case.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the reply from AnkitaaMishra , please allow me to provide another insight:
Hi, @RichOB
AnkitaaMishra 's solution is a good idea for measures.Now, I will provide a solution for calculated columns:
1.Firstly, you need to create the following two calculated columns:
end1 =
IF ( ISBLANK ( 'Table'[End Date] ), EOMONTH ( TODAY (), 0 ), 'Table'[End Date] )
Number of Days1 =
IF (
ISBLANK ( 'Table'[End Date] ),
DATEDIFF ( 'Table'[Start Date], EOMONTH ( TODAY (), 0 ), DAY ) + 1,
DATEDIFF ( 'Table'[Start Date], 'Table'[End Date], DAY ) + 1
)
2.Here's my final result, which I hope meets your requirements.
Please find the attached pbix relevant to the case.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @RichOB ,
Try below DAX to create a measure:
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
114 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
165 | |
116 | |
63 | |
57 | |
50 |