Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Sapotyuk
Regular Visitor

How to compare a column with non-zero values for different years

Hello all.

 

I have a table AAA with ShopNb, qty Visiteurs and date (2021 and 2020 years) and table Calendar ( CALENDARAUTO ()

 

I need to compare two measure, which have visitors values> 0 for the same stores for the same period (2021 vs 2020 ( example 01/01/2021 vs 01/01/2020)

 

I created: 

1. Traffic 2021 = sum('AAA'[Visiteurs])

2. Traffic 2020 = CALCULATE(sum('AAA'[Visiteurs]),SAMEPERIODLASTYEAR(Calendar'[Date]))

 

after that I have such table:

 

I don`t know how use filter Traffic 2021>0 & Traffic 2020>0, because it`s measures. I tried to use if statement, but the sum of column doesn`t change. How can i solve this problem? Thanks a lot

1234.png

 

 

2 REPLIES 2
Sapotyuk
Regular Visitor

@amitchandak ,it only works for for the table. When i create measure TOTALMTD() it doest work. is there a solution when using functions TOTALMTD()?

amitchandak
Super User
Super User

@Sapotyuk , on way is to put visual level filter

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.