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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
devika
Helper II
Helper II

Line graph to stop showing future Quarters

Hi All,

 

I have connected to Oracle SQL. I used Year and Quarter from the Date hierarchy for the X-axis. I haven't created a separate Date table. There is a data lag in the dataset. As you can see, 'Maxofdate' is five weeks behind from today, and this is going to be subjective. I want the line graph to stop showing at 'Maxofdate-Quarter' and not showing the future Quarters.

The below graph should show only until 2023 Q1, not other Quarters with blanks.

Creating a date table won't help, and I can't use visual or page filters to remove blanks; I can use filters only in the Measures.

 

devika_2-1675813856226.png

check =


VAR MinDate = Min([DATE])
VAR MaxDate = Max(DATE])
RETURN
CALCULATE(IF(MAX[DATE]) < MinDate || MAX([CASE_DATE]) > MaxDate,BLANK(),[answer]))

 

Any thoughts are much appreciated.

 

 

 

 

 

 

 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@devika , Try like

 

check =

VAR MinDate = MinX(allselected(Date), [DATE])
VAR MaxDate = MaxX(allselected(Date),DATE])
RETURN
CALCULATE(IF(MAX([DATE]) < MinDate || MAX([CASE_DATE]) > MaxDate,BLANK(),[answer]) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

devika
Helper II
Helper II

Thanks Amit, it works perfectly.

View solution in original post

3 REPLIES 3
devika
Helper II
Helper II

Thanks Amit, it works perfectly.

amitchandak
Super User
Super User

@devika , Try like

 

check =

VAR MinDate = MinX(allselected(Date), [DATE])
VAR MaxDate = MaxX(allselected(Date),DATE])
RETURN
CALCULATE(IF(MAX([DATE]) < MinDate || MAX([CASE_DATE]) > MaxDate,BLANK(),[answer]) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi. This has a side-effect, I believe. If you put this measure in a table visual, the grand total of the year will be blank when we are in the current year. Any way to avoid this? the grand total should be the last nonblank value of the measure.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors