Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi.
I have a budget control graph as shown below.
The bar graph is the actual YTD and the line graph is the budget YTD.
The code is as follows.
Actual YTD = CALCULATE('Budget Control'[Actual TTL],DATESYTD('Calender'[Date]))
I would like to link this graph to a slicer so that when the user selects a single month, the YTD of the bar graph for actual is displayed up to the month selected in the slicer and not beyond.
But I want the budget YTD to be displayed through December.
How should the code for the actual YTD be calculated?
Sorry for the rudimentary question, but please help.
Solved! Go to Solution.
Hi @nanacobsbs ,
Based on your description, I have created a simple sample:
Please try:
First duplicat the calendar table for slicer:
Then apply the measrue:
Actual = IF(MAX('Calendar'[Date])<=MAX('For slicer'[Date]),SUM('Budget Control'[Actual TTL]))
SUM of Budget = IF(MAX('Calendar'[Date])<=MAX('For slicer'[Date]),SUM('Budget Control'[Budget]))
Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @nanacobsbs ,
Based on your description, I have created a simple sample:
Please try:
First duplicat the calendar table for slicer:
Then apply the measrue:
Actual = IF(MAX('Calendar'[Date])<=MAX('For slicer'[Date]),SUM('Budget Control'[Actual TTL]))
SUM of Budget = IF(MAX('Calendar'[Date])<=MAX('For slicer'[Date]),SUM('Budget Control'[Budget]))
Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you very much for your help!!
It works!!!
@nanacobsbs , Assuming Actual is a measure
You new measure should be . else you have to use sum( [Actual TTL])
Actual YTD = CALCULATE( [Actual TTL],DATESYTD('Calender'[Date]))
Also the axis and filter should be on Date table
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s
If you select one month and want to display more than that
Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI
Thank you for your help!!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
10 | |
10 | |
9 | |
8 |
User | Count |
---|---|
17 | |
13 | |
12 | |
11 | |
9 |