Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
I have a line and stacked column chart and i'm trying to show the previous 5 months by month end date on the left side of the x-axis (the blue box on my screenshot) and on the right side of the x-axis, I want to only show yesterday's date (the red box). I have my SQL query to allow for this but when I put the date column into the chart, it returns every day of my current month (the green box) BUT it does show previous 5 months by month end date.
Does anyone know if it's possible to get rid of the dates in the current month (the green box)?
Thank you!
Hi @BIUser2024 ,
I don't know how you created that visual object, so I may not be able to give you a solution based on what you have first. But I can provide you with a workaround.
Here is my sample data:
And I add a Table X-axis for the x-axis of the visual:
Use these DAXs to create measures to calculate the previous 5 month and yesterday:
Yesterday =
CALCULATE(
SUM('Table'[Value]),
'Table'[Date] = TODAY() - 1
)
previous month_1 =
CALCULATE(
SUM('Table'[Value]),
'Table'[Date] = EOMONTH(TODAY(), -1)
)
previous month_2 =
CALCULATE(
SUM('Table'[Value]),
'Table'[Date] = EOMONTH(TODAY(), -2)
)
previous month_3 =
CALCULATE(
SUM('Table'[Value]),
'Table'[Date] = EOMONTH(TODAY(), -3)
)
previous month_4 =
CALCULATE(
SUM('Table'[Value]),
'Table'[Date] = EOMONTH(TODAY(), -4)
)
previous month_5 =
CALCULATE(
SUM('Table'[Value]),
'Table'[Date] = EOMONTH(TODAY(), -5)
)
And use this DAX to create a measure for the Y-axis of the visual:
Y-axis =
SWITCH(
TRUE(),
SELECTEDVALUE('X-axis'[X-axis]) = "previous 5 month", [previous month_5],
SELECTEDVALUE('X-axis'[X-axis]) = "previous 4 month", [previous month_4],
SELECTEDVALUE('X-axis'[X-axis]) = "previous 3 month", [previous month_3],
SELECTEDVALUE('X-axis'[X-axis]) = "previous 2 month", [previous month_2],
SELECTEDVALUE('X-axis'[X-axis]) = "previous 1 month", [previous month_1],
SELECTEDVALUE('X-axis'[X-axis]) = "Yesterday", [Yesterday]
)
Then build the visual like this and the final output is as below:
If this solution does not solve your problem, could you please provide a bit of detail about how you created the visual object, such as the code you used and which fields were placed where in the visual object?
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.