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!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hello wizards of PBI! I need some help with a dax measure.
I want to have a card at the bottom of the page outputting the date range selected.
Something like: "first month" - "last month", which would output Feb-Apr etc
I would also like it to only output 1 month if only 1 is selected.
I've never really messed around with adding text in this way. Is it possible?
Solved! Go to Solution.
@StefanM, try this measure:
Label Period Selected =
VAR vStartDate =
MIN ( 'Date'[Date] )
VAR vEndDate =
MAX ( 'Date'[Date] )
VAR vYear =
YEAR ( vEndDate )
VAR vStartMonth =
FORMAT ( vStartDate, "mmm" )
VAR vEndMonth =
FORMAT ( vEndDate, "mmm" )
VAR vMonthLabel =
IF ( vStartMonth = vEndMonth, vEndMonth, vStartMonth & " - " & vEndMonth )
VAR vResult =
vYear & " " & vMonthLabel
RETURN
vResult
Display the measure in a card:
Proud to be a Super User!
@StefanM, try this measure:
Label Period Selected =
VAR vStartDate =
MIN ( 'Date'[Date] )
VAR vEndDate =
MAX ( 'Date'[Date] )
VAR vYear =
YEAR ( vEndDate )
VAR vStartMonth =
FORMAT ( vStartDate, "mmm" )
VAR vEndMonth =
FORMAT ( vEndDate, "mmm" )
VAR vMonthLabel =
IF ( vStartMonth = vEndMonth, vEndMonth, vStartMonth & " - " & vEndMonth )
VAR vResult =
vYear & " " & vMonthLabel
RETURN
vResult
Display the measure in a card:
Proud to be a Super User!
This works brilliantly. The only part I've left to do is to display another year for when the first month is from a different year, but with your easy to follow formula, I don't think that won't be a problem ^^
Thanks a lot @DataInsights 👍
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 53 | |
| 48 | |
| 35 | |
| 14 | |
| 14 |
| User | Count |
|---|---|
| 93 | |
| 79 | |
| 37 | |
| 27 | |
| 25 |