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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
PaulVanS267
Frequent Visitor

Marketshare over time using play axis and tree map

Good morning, 

 

I wonder if anyone can help me with this. I have table that has sales over a period of 4 years for various brands. I wanted to show the market share of the brands using a tree map  and a play axis so the user is able to see how the market share has changed over time.

 

To do this, in my Treemap, I have the following expression:

Total Sales by Year Selected = 
VAR myyear = 
IF(SELECTEDVALUE(dimCalendar[Year])=BLANK(),2021,SELECTEDVALUE(dimCalendar[Year]))
RETURN
CALCULATE([Total Sales],FILTER(dimCalendar,dimCalendar[Year]=myyear))

and the category is [Brand]

 

My Play Axis field is [Year]

 

For the years 2018, 2019 and 2021... the chart works perfectly.  HOWEVER, in 2020, the chart looks as follows:

PaulVanS267_0-1684237979864.png

 

The highlighted values are the correct amounts for 2020.  However, the rest of the boxes are all the values for 2021.  

I assume this is due to the following:

  1. In 2020, there were no sales for any of the brands EXCEPT Samsung and LG.
  2. Due to the way I have consturucted the variable inside my expression for all of these brands with no sales, the measure has defaulted to calculating the sales for 2021 instead.

The reason I have used this variable is that I want the chart to default to 2021 when the play axis is not running and therefore no value is selected. But naturally, in years where there is no sales and the play axis is running I would like those to be not visible.

 

Can someone please help me with this?

 

Kind regards,

 

Paul

0 REPLIES 0

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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