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

October 28 & 29: Experts share their secrets on how to pass the Fabric Analytics Engineer certification exam—live. Learn more

Reply
brinky
Helper IV
Helper IV

Switch

Good morning,

 

I'm wondering if it's possible to have % difference columns in a switch function.

 

I have this switch function which is returning yearly sales? I would like to add 2 columns showing the % diff from 2020 & 2019.

 

Screenshot 2021-09-21 070137.pngScreenshot 2021-09-21 065534.png

 

Thanks in advance.

@amitchandak 

4 REPLIES 4
amitchandak
Super User
Super User

@brinky , if you have date table and year week coming from there. Last year same day week is 1 year behind , which can be used

example

Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-364,Day))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Thanks Amit for your prompt reply, maybe I didn't explain myself well.

 

This is what I'm trying to add to my yearly sales.

 

Screenshot 2021-09-21 072410.png

@brinky , If year is column(used in matrix column, you need a hybrid table). Not a direct option, you need alternatives 

 

Otherwise, use [Measure] and [Change %]  measure as values

 

 

if you are looking for a Hybrid display with Matrix Column and measure
https://community.powerbi.com/t5/Community-Blog/Creating-a-custom-or-hybrid-matrix-in-PowerBI/ba-p/1...
https://community.powerbi.com/t5/Quick-Measures-Gallery/The-New-Hotness-Custom-Matrix-Hierarchy/m-p/...

vote for Hybrid Table
https://ideas.powerbi.com/ideas/idea/?ideaid=9bc32b23-1eb1-4e74-8b34-349887b37ebc

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Thanks Amit, this looks interesting.

 

As a superuser 😉 just for curiosity are there any altermatives?

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

October NL Carousel

Fabric Community Update - October 2024

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