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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
Anonymous
Not applicable

Page filters using calculation groups

Hi, I'm currently using a calculation group as a page filter so that all components are filtered by a 12-month period, using the end date of the date slicer (a 'Date Selection' table just used for parameter selection) that filters on the main date table ('Date') used by all the measures

 

VAR EndDate = EOMONTH ( MAX ( 'Date Selection'[Date] ), 0 ) 
VAR
StartDate = EDATE (EndDate, -12 )
RETURN CALCULATE
( SELECTEDMEASURE (), FILTER ( 'Date', 'Date'[Date] <= EndDate && 'Date'[Date] > StartDate ) )

 

Everything works well. However, I've noticed weird behaviour with some calculated measures. If I have a chart with dates on the x-axis, it will show only 12 months for everything except for measures that are manipulated in specific ways. For instance, if I create a measure with just a constant:


Test Measure = 5

And then plot it on a chart with time on the x-axis, it will show all dates instead of just 12 months. However, if I do something like this:

 

Test Measure = IF(ISBLANK(MAX('Date'[Date])), BLANK(), 5)
 
Then the visual will again restrict to the 12 month period on the x-axis. 
 
I have no idea why this is happening and I don't want to just modify measures like this with this IF() statement without fully understanding what's going on. 
 
Can someone help explain this?
 
Thanks

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Items that are not connected to your data model (like your Test Measure)  will also not be impacted by filter context. That means if you include these items in your visuals you create cartesian products.

 

As soon as you tie these items into your data model they will be subject to the filter context and join rules.

View solution in original post

2 REPLIES 2
AlSnyder
Frequent Visitor

   This is a simple relationship issue.
   A constant measure doesn't have a relationship to your date table.  Your IF statement creates a relationship to the date table by checking if the dates are blank and then applying the constant to dates that are not blank.
   You may also experience a similar result if you have other measures that produce scalar outputs that also do not have relationships with the date table.

lbendlin
Super User
Super User

Items that are not connected to your data model (like your Test Measure)  will also not be impacted by filter context. That means if you include these items in your visuals you create cartesian products.

 

As soon as you tie these items into your data model they will be subject to the filter context and join rules.

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.