Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I'm at an impass, I've got a table with the start and end date and a column that identifes the number of dates in between.
I've written the following measure
Absence Days in Mth =
VAR firstDayOfMonth =
MIN ( 'DateDimension'[Date] )
VAR lastDayOfMonth =
MAX ( 'DateDimension'[Date] )
RETURN
SUMX (
Absence,
VAR s =
MAX ( Absence[StartDate], firstDayOfMonth )
VAR e =
MIN (Absence[EndDate], lastDayOfMonth )
RETURN
IF ( s < e, DATEDIFF ( s-1, e, DAY ) )
)
When I put this measure as a card on my report and then use the Month (date Table) as a filter I get the correct value for March of 4. For April I get 30 rather than 30 + 22 from the first row.
My date table is joined to the absence table on date - startdate.
How do I get this so it picks up the April figure of the first record when I filter for April.
TIA
Solved! Go to Solution.
In general, calendar table in such inteval calculations doesn't function as a dimension like other date-oriented analysis.
Tricky solution to the tricky question,
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
In general, calendar table in such inteval calculations doesn't function as a dimension like other date-oriented analysis.
Tricky solution to the tricky question,
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Thank you, thats worked perfectly.
Check out the July 2025 Power BI update to learn about new features.