Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
I would like to build a query in which the results is the last day of june every year. Example since we are in march of 24 right now I would like the table to return 6/30/24, however on 7/1/25 I would like it to return 6/30/26.
Solved! Go to Solution.
hi @Greyangel
welcome tot he community.
you could do the follwing to determine it:
let
EndOfJuneDate = (yourEvaluationDate as date) =>
let
currentYear = Date.Year(yourEvaluationDate),
nextYear = currentYear + 1,
lastDayOfJune = #date(currentYear, 6, 30),
nextYearFirstDay = #date(nextYear, 1, 1)
in
if yourEvaluationDate >= lastDayOfJune then
nextYearFirstDay
else
lastDayOfJune
in
EndOfJuneDate
This is what happens
hi @Greyangel
welcome tot he community.
you could do the follwing to determine it:
let
EndOfJuneDate = (yourEvaluationDate as date) =>
let
currentYear = Date.Year(yourEvaluationDate),
nextYear = currentYear + 1,
lastDayOfJune = #date(currentYear, 6, 30),
nextYearFirstDay = #date(nextYear, 1, 1)
in
if yourEvaluationDate >= lastDayOfJune then
nextYearFirstDay
else
lastDayOfJune
in
EndOfJuneDate
This is what happens
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 57 | |
| 52 | |
| 45 | |
| 17 | |
| 16 |
| User | Count |
|---|---|
| 109 | |
| 108 | |
| 40 | |
| 33 | |
| 26 |