The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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:
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:
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
User | Count |
---|---|
15 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
24 | |
21 | |
12 | |
10 | |
7 |