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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Nele90
New Member

Different filters to one table

Hi there,

 

I am quite new to PowerBi and seem to have a simple question but that I cannot seem to solve myself.

My table looks like the example below:

 

YearContract numberCharged amount
20201500
20202500
20191100
20192500

 

If I would only be interested in the amount for one year, I could apply a filter. However, I would like to compare the amounts charged in 2019 vs. 2020 and have a table similar to this one:

YearContract numberCharged amount in 2019Charged amount in 2020
20201100500
20202500500

Is there any possibility of applying two different filters to 2 columns in the same table?

Thank you for your help.

Kind regards,

Nele

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Nele90 , Create a table with distinct years, day date and then create measures like

 

//Only year vs Year, not a level below

This Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))
diff = [This Year]-[Last Year ]
diff % = divide([This Year]-[Last Year ],[Last Year ])

 

Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Nele90 , Create a table with distinct years, day date and then create measures like

 

//Only year vs Year, not a level below

This Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))
diff = [This Year]-[Last Year ]
diff % = divide([This Year]-[Last Year ],[Last Year ])

 

Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.