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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors