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
Anonymous
Not applicable

Grouping years superior to 2021

Hello,

I want to represent on a clustered chart data over the years  like this

 

I don't need to represent 2021,2022,2023, etc.. So, start from 2021, I want to group years 

 

I managed to do it by a Calculated Column, but it's a String column..Therefore, all my Time Intelligence evolution are wrong

 

So I wonder if it's possible to group Years on a clustered chart by an easy way ?

 

thanks !

 

4 REPLIES 4
Anonymous
Not applicable

the tooltip is driving me crazy 🙂 

 

I use you file @v-frfei-msft  and I've added 2 columns, one with some ID's and one equals to Year - 1

 

I've joined the file here

 

First I calculate how many projects there are 

 

#Nb_Projects = DISTINCTCOUNT(Table1[ID])
 
Depending on which bar I roll over, I want to display how many projects on the year before
 
But it keeps displaying the value of the year rolled over....
 
2019-04-23_16h46_30.png
 
 
My measure
 
#YearBefore = 

var whichYear = SELECTEDVALUE(Table1[Year])
var groupYear = SELECTEDVALUE(Table1[Column])

var year_n1 = SELECTEDVALUE(Table1[Year - 1])
var yearToCompare = if(groupYear="above 2021";2020;year_n1)
return

CALCULATE([#Nb_Projects];Table1[Year - 1]=yearToCompare)
Many thanks!
 
 
Anonymous
Not applicable

anyone knows how I can display the evolution between bars in that case ? 

v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

One sample for your reference, please check the following steps as below.

 

1. Change the data type of Year column to Number.

Capture.PNG

 

2. Create a calculated column using the formula sa below.

 

Column = IF(Table1[Year]>=2021,"above 2021",""&Table1[Year])

3. Then we can get the visual as we excepted.

2.PNG

 

Alternatively, we can gourp the column directly. Please refer to the screen shots as below.

gourp1.PNGgroup2.PNG

 

Pbix as attached.

 

 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

Hi @v-frfei-msft 

 

thanks for your answer. It's pretty much the same of my attempt actually.


At the end, the calculated column "Column" is a text. Therefore the time intelligence evolution between the different bars can't work because Power BI expects a year

 

I feel I have no choice to create that kind of measure (quick measure) ....
2019-04-23_11h57_41.png

....but adapted to a text type column

 

Do you understand what I mean?

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.