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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello,
Ok i'm going to have a new attempt at this question with more information for the community to use to help me decipher this issue.
Currently I am trying to create a measure that will indicate the period end date associated to a schedule date for every single activity. I have created two versions of this measure:
Version 1:
Sch End Period Measure 1 =
VAR enddate = MAX(Activity_F[Schedule Date])
RETURN
CALCULATE(
MIN(Date_D[Period End Date]),
Filter(ALL(Date_D), Date_D[Period End Date] > enddate)
)
Version 2:
Sch End Period Measure 2 =
VAR enddate = MIN(Activity_F[Schedule Date])
VAR FilteredCalendar = Filter(ADDCOLUMNS(Date_D, "Friday", Date_D[Period End Date]), [Friday] > enddate)
RETURN
MINX(FilteredCalendar, [Friday])
The problem comes when I am filtering the data, in this example, the page is filtered to project 1 this is what I get when the measures are NOT included:
When I include either measures, the results for both my measures are the same and is as such:
The key thing to note is Activity 1485 is not even in project 1
So the question is why is my measure bringing in values outside of the visual's filter?
See link to sample dataset:
Hi @AlvinLy ,
1. I think this is due to the table to table relationship, you can modify the relationship.
2.Create measure.
Measure =
VAR _seleted =
SELECTEDVALUE ( Project_D[Project] )
VAR _projectID =
MAXX (
FILTER ( 'Project_D', 'Project_D'[Project] = _seleted ),
'Project_D'[ID]
)
VAR _table =
CALCULATETABLE (
SUMMARIZE (
FILTER ( ALLSELECTED ( 'Activity_F' ), 'Activity_F'[Project ID] = _projectID ),
Activity_F[Activity ID],
'Activity_F'[Activity Step],
Activity_F[Schedule Date],
"maxday", MAX ( 'Activity_F'[Schedule Date] )
)
)
VAR _table2 =
ADDCOLUMNS (
_table,
"day",
CALCULATE (
MIN ( 'Date_D'[Period End Date] ),
FILTER ( 'Date_D', 'Date_D'[Period End Date] > [maxday] )
)
)
VAR _activityID =
SELECTEDVALUE ( Activity_F[Activity ID] )
// VAR enddate =
// MAXX ( _table, 'Activity_F'[Schedule Date] )
RETURN
MAXX ( FILTER ( _table2, 'Activity_F'[Activity ID] = _activityID ), [day] )
If your Current Period does not refer to this, please clarify in a follow-up reply.
Best Regards,
Clara Gong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Clara,
Thank you for looking at my post.
1. Yes i have my table relationships setup in the way you've shown above.
2. Although I understand the direction of the code, and it is helpful to get this example; I'm not sure this is a robust solution for me. The example I provided is a sample of my actual data which has many more parameters that I need to filter from. Project ID was one of the many parameters. I think your code focuses specifically on project ID and building a "new" table (_table) from project ID. I have about 5 other filters that I would need to use in my actual data and the report visualizations. Would I need to go through and include each one as a filter in the measure?
3. I don't think i provided a good example of what i wanted to see which is the periond end date for each activity step. This snap shot is what I would like to see, but with the projects being filtered to one specific project or in my actual data any other filters I want to employ
I guess i'm trying to look for a solution, where if i were to filter by any related dimension in a connected dimension table (since my actual data is a much larger model), without having to explicitly note each dimension in the measure. Hoping to see a more robust code that won't need manual intervention each time