Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I'm creating a line and stacked column chart and having a problem with the measure that should be plotted on the line. The x-axis is time (one entry for each month). I have two slicers, and teh bars on the chart are correct.
We want the line to be a constant valuer that indicates the budget as it was planned in January. The budget is updated every month with an evergreen value, but we want to display the original budget as a constant for each monthly entry. So I want to continue using the slicer values in the filter but want to override the time context. I tried:
Annual Budget = CALCULATE (
'Measures'[Annual OP],
KEEPFILTERS(Month('Date'[Date] = 1))
)
What I'm trying to do here is keep the slicer filters but then force date filter to always use month 1. What I'm seeing though is that the Annual Budget still cahnges monthly and equals the Annual OP value for each month (instead of always using the Annual OP value for January).
Solved! Go to Solution.
Apologies...I missed something the first time through it. You want to ALWAYS use January numbers. What I originally posted won't do that. Try this instead.
Annual Budget =
DIM CurrentYear = YEAR(TODAY())
RETURN
CALCULATE(
[Annual OP],
FILTER(
DateTable,
DateTable[Year] = CurrentYear &&
DateTable[MonthNumber] = 1
),
ALLEXCEPT(
FactTable,
Organization[ID]
)
)
The FILTER part should keep it for January for the current year. And ALLEXCEPT should keep the organization filters. I have no idea what any of your tables/fields are named so I improvised...
Try this...
Annual Budget = CALCULATE (
'Measures'[Annual OP],
ALLEXCEPT('Date','Date'[Date])
)
Thank you for the reply. I think this is close, but I'm still having problems because I didn't describe the slicers well enough.
I have slicers on 2 of the dimensions
The first slicer is on the Year field in the date hierarchy in the Date dimension.
The second slicer is on the Organization hierarchy in the Organization dimension.
I need the first slicer to continue restricting the graph for a single year.
The problem is that the month field that I'm iterating over and want to keep constant (to retrieve January) is in the same date hierarchy as the Year field in the slicer.
Apologies...I missed something the first time through it. You want to ALWAYS use January numbers. What I originally posted won't do that. Try this instead.
Annual Budget =
DIM CurrentYear = YEAR(TODAY())
RETURN
CALCULATE(
[Annual OP],
FILTER(
DateTable,
DateTable[Year] = CurrentYear &&
DateTable[MonthNumber] = 1
),
ALLEXCEPT(
FactTable,
Organization[ID]
)
)
The FILTER part should keep it for January for the current year. And ALLEXCEPT should keep the organization filters. I have no idea what any of your tables/fields are named so I improvised...
I didn't think of using a variable, so let me play with that. This was very helpful.
I'm still not getting what I want, but I'm not sure if some of it comes from misunderstanding the data.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
24 | |
9 | |
7 | |
6 | |
6 |
User | Count |
---|---|
29 | |
11 | |
11 | |
10 | |
6 |