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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello,
I have several line charts in a report where date in on the x-axis like this
Is there a smart way to draw vertical lines on certain days, like when a certain marketing campaign started or other events happened? Of course the lines should stay on their x-axis position and when the date slicer moves it out of view or new data gets added it should stay at the correct position on the x-axis.
Zap.
Solved! Go to Solution.
Hi,
According to your description, i think your requirement can not be reached completely, but i have a workaround:
Please choose Line and Clustered Column Chart visual.
Then try this measure:
Measure =
IF (
DISTINCTCOUNT ( 'Slicer Table'[Date] ) = BLANK ()
|| DISTINCTCOUNT ( 'Slicer Table'[Date] )
= CALCULATE ( DISTINCTCOUNT ( 'Slicer Table'[Date] ), ALL ( 'Slicer Table' ) ),
BLANK (),
IF (
MIN ( 'Table'[Date] ) IN DISTINCT ( 'Slicer Table'[Date] ),
MAXX (
CALCULATETABLE ( DISTINCT ( 'Table'[Date] ), ALLSELECTED ( 'Table'[Date] ) ),
CALCULATE ( SUM ( 'Table'[Sales] ) )
)
)
)Create another seperate slicer table:
Slicer Table = SELECTCOLUMNS('Table',"Date",'Table'[Date])When choose one or more dates you want in slicer, the result shows:
You can also use another custom visual called Multiple Axes Chart - XViz :
The result shows:
Here is my test pbix file:
Hope this helps.
Best Regards,
Giotto Zhi
Hi,
According to your description, i think your requirement can not be reached completely, but i have a workaround:
Please choose Line and Clustered Column Chart visual.
Then try this measure:
Measure =
IF (
DISTINCTCOUNT ( 'Slicer Table'[Date] ) = BLANK ()
|| DISTINCTCOUNT ( 'Slicer Table'[Date] )
= CALCULATE ( DISTINCTCOUNT ( 'Slicer Table'[Date] ), ALL ( 'Slicer Table' ) ),
BLANK (),
IF (
MIN ( 'Table'[Date] ) IN DISTINCT ( 'Slicer Table'[Date] ),
MAXX (
CALCULATETABLE ( DISTINCT ( 'Table'[Date] ), ALLSELECTED ( 'Table'[Date] ) ),
CALCULATE ( SUM ( 'Table'[Sales] ) )
)
)
)Create another seperate slicer table:
Slicer Table = SELECTCOLUMNS('Table',"Date",'Table'[Date])When choose one or more dates you want in slicer, the result shows:
You can also use another custom visual called Multiple Axes Chart - XViz :
The result shows:
Here is my test pbix file:
Hope this helps.
Best Regards,
Giotto Zhi
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 38 | |
| 38 | |
| 28 | |
| 27 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 73 | |
| 66 | |
| 65 |