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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
STEPH0018
Helper II
Helper II

Auxiliary dCalendar

Hi, guys, I need to create an auxiliary dcalendar to use in a line graph only the date from the range of the date selected by the user.

 

STEPH0018_0-1629815444866.png

 

In the case of the chart above, I would like to show the data from 12/31/2019, the last day of the year before the selected date, until 01/06/2020, which is the selected date. When I try to create a range using datesbetwenn it doesn't understand the range. Is it possible to do this with dax?

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

@STEPH0018 So, you would want your calendar table disconnected from your slicer and then you could do this:

Measure =
  VAR __MaxDate = SELECTEDVALUE('Slicer'[Date])
  VAR __MinDate = DATE(YEAR(__MaxDate)-1,12,31)
  VAR __CurrentDate = MAX('DateAxisTable'[Date])
RETURN
  IF(__CurrentDate >= __MinDate && __CurrentDate <= __MaxDate,[your measure to display],BLANK())


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...


The idea would be how to put the two dates here automatically:

 

STEPH0018_0-1629819529060.png

 

I, Greg, so I would like to make the change only to the graph, not the measure. A filter in the visual to show just before the user-selected date until the last day of the previous year, measurement values ​​do not change. But quaht would be the 'Slicer'[Date]?

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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