Forum Discussion
Excluding Future Years from DAX Code
Thanks for your patience and ongoing explanations.
1) You are teaching me that Filter Context & X-axis labels are 2 completely different things.
(Interesting. I have always thought that X-axis labels were part of the filter context. Although this doesn't make sense to me, because the year is certainly filtering the y-axis values differently for each year, I will memorize this anyway.)
2) You are teaching me that:
A) "the results of a measure cannot [possibly] affect what shows in the x-axis".
B) "unless you add a filter to the visual/page/report, there is literally nothing you can do to remove 2024 from the x-axis through DAX".
Again, I will memorize these things. However, I am still confused by what I see.
I have 2 reports.
- The first report shares its dataset so that other reports can use it.
- The second report uses the shared dataset.
For the above thread, all of my measures & screenshots were from the first report.
When viewing the chart in report #1, 2024 is there.
However, when viewing the identical measure in report #2, 2024 is NOT there.
As you say, "unless you add a filter to the visual/page/report, there is literally nothing you can do to remove 2024 from the x-axis through DAX".
The thing is that there is not a single filter on the visual/page/report that pertains to this visual.
So.....
- It's not a filter on the visual/page/report.
- It's not a difference in the measure because it's a shared dataset. (But this wouldn't matter anyway, right? Even if the measure was different, it still couldn't possibly get rid of 2024 anyway.)
- It's not a difference in the data because it's a shared dataset. (In fact, the visuals are identical in data, except for 2024 being present in one report and absent from the other.
In summary, not everything you are saying makes sense, but I am memorizing it anyway in hopes that it will make sense in the future.
More importantly, what Power BI is showing me in the second report contradicts what you are saying. I'm still lost.
Regards,
Nathan
- Wilson_3 years agoMemorable Member
Nathan,
lmao I'm of course also open to my knowledge needing an update. If your empirical evidence is showing me I'm wrong, then obviously I have something else to learn. Always something more to learn with Power BI. I appreciate you poking holes in my understanding haha. 😄
If anybody who sees this in the future can clear this up for both of us, that'd be awesome. Maybe the fact that it's using an existing dataset vs being in the pbix with the dataset does actually make a difference for some reason. Maybe it's something else.
P.S.: To be clear about my original comment about filter context and x-axis labels being different things, I was not saying that x-axis labels aren't part of the filter context. I was merely asserting at the time that they were not synonymous (ie: while the x-axis affects the filter context, the filter context doesn't affect the x-axis).