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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
I'm looking to graph box count data by month versus a previous year.
My data goes back multiple years but only looking to go back 1 year. Any ideas on how to do this and the best graph to use? Right now i have the year selected for the legend but i'm not able to select the year, it simply graphs all data.
Solved! Go to Solution.
Hi @BI101
You can refer to the following sample.
Sample data
Create a measure
MEASURE =
VAR a =
MAXX ( ALLSELECTED ( 'Table' ), YEAR ( [Date] ) )
VAR b = a - 1
RETURN
CALCULATE (
COUNTROWS ( 'Table' ),
OR ( YEAR ( 'Table'[Date] ) = a, YEAR ( 'Table'[Date] ) = b )
)
Then put the measure and related value to visual.
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Share the download link of the PBI file.
Hi @BI101
You can refer to the following sample.
Sample data
Create a measure
MEASURE =
VAR a =
MAXX ( ALLSELECTED ( 'Table' ), YEAR ( [Date] ) )
VAR b = a - 1
RETURN
CALCULATE (
COUNTROWS ( 'Table' ),
OR ( YEAR ( 'Table'[Date] ) = a, YEAR ( 'Table'[Date] ) = b )
)
Then put the measure and related value to visual.
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!