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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hello,
new to powe bi, i need to compare last year month count to presene year count, if value increase need to show arrow mark should be up, if decrease arrow should be down in conditional formate
when i use date date add, parallell period, privious month it will compare with in the year of month it won't give result last year month screen shot below
pls help me sort out this issue
Solved! Go to Solution.
Hi @Anonymous ,
Use a single slicer and create two measures like below:
current_year_month =
CALCULATE (
COUNT ( 'table'[value] ),
FILTER (
ALLSELECTED ( 'table' ),
'table'[plant] = SELECTEDVALUE ( 'table'[plant] )
&& YEAR ( 'table'[date] ) = YEAR ( SELECTEDVALUE ( 'table'[date] ) )
&& MONTH ( 'table'[date] ) = MONTH ( SELECTEDVALUE ( 'table'[date] ) )
)
)
Last_year_month =
CALCULATE (
COUNT ( 'table'[value] ),
FILTER (
ALLSELECTED ( 'table' ),
'table'[plant] = SELECTEDVALUE ( 'table'[plant] )
&& YEAR ( 'table'[date] )
= YEAR ( SELECTEDVALUE ( 'table'[date] ) ) - 1
&& MONTH ( 'table'[date] ) = MONTH ( SELECTEDVALUE ( 'table'[date] ) )
)
)
Best Regards,
Jay
Hi @Anonymous
try with two slicers, one for the year and one for the month and avoid using hierarchy slicer
Hi @Anonymous ,
Use a single slicer and create two measures like below:
current_year_month =
CALCULATE (
COUNT ( 'table'[value] ),
FILTER (
ALLSELECTED ( 'table' ),
'table'[plant] = SELECTEDVALUE ( 'table'[plant] )
&& YEAR ( 'table'[date] ) = YEAR ( SELECTEDVALUE ( 'table'[date] ) )
&& MONTH ( 'table'[date] ) = MONTH ( SELECTEDVALUE ( 'table'[date] ) )
)
)
Last_year_month =
CALCULATE (
COUNT ( 'table'[value] ),
FILTER (
ALLSELECTED ( 'table' ),
'table'[plant] = SELECTEDVALUE ( 'table'[plant] )
&& YEAR ( 'table'[date] )
= YEAR ( SELECTEDVALUE ( 'table'[date] ) ) - 1
&& MONTH ( 'table'[date] ) = MONTH ( SELECTEDVALUE ( 'table'[date] ) )
)
)
Best Regards,
Jay
Check out the November 2025 Fabric 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!