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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
MelissaJPF27
New Member

Combining Categories < 2% when category is date.

Hi, 

 

I am looking to create a graph like the below but combining any values less than 2% into an 'Others' category (in this case, combining 2015, 2019 & 2020 together). 

MelissaJPF27_0-1737626686922.png

 

This is a snippet of my data - it needs to be a unique count as the same reference number may have multiple entries but the date is always the same per ref number. There may be multiple references with the same date. I only need it to be split by year and not day or month. I have 13521 rows and 46 columns in my file currently so this is just a sample but I think covers the key details for what is needed to make this graph - I just need something to combine values for the smaller years so they can be clearly shown on the graph. 

I have tried a few different commands & methods but haven't found a solution yet. 

 

Reference_NumberDate_CreatedSourceStatus
123/10/2019OOpen
123/10/2019OOpen
123/10/2019OOpen
123/10/2019OOpen
123/10/2019OOpen
123/10/2019OOpen
208/09/2020OOpen
323/10/2020OOpen
424/11/2020OOpen
519/02/2021OOpen
519/02/2021OOpen
519/02/2021OOpen
519/02/2021OOpen
620/12/2021OOpen
620/12/2021OOpen
620/12/2021OOpen
620/12/2021OOpen
703/01/2022OOpen
703/01/2022OOpen
703/01/2022OOpen
703/01/2022OOpen
703/01/2022OOpen
821/01/2022OOpen
821/01/2022OOpen
821/01/2022OOpen
821/01/2022OOpen
910/02/2022OOpen
910/02/2022OOpen
910/02/2022OOpen
910/02/2022OOpen
1021/03/2022OOpen
1021/03/2022OOpen
1021/03/2022OOpen
1021/03/2022OOpen
1021/03/2022OOpen
1021/03/2022OOpen
1125/03/2022OOpen
1125/03/2022OOpen
1125/03/2022OOpen
1125/03/2022OOpen
1125/03/2022OOpen
1204/05/2022OOpen
1330/08/2022OOpen
1424/04/2023OOpen
1525/04/2023OOpen
1619/06/2023OOpen
1707/07/2023OOpen
1819/10/2023OOpen
1919/10/2023OOpen
2008/11/2023OOpen

 

Thank you

2 REPLIES 2
bhanu_gautam
Super User
Super User

@MelissaJPF27 , Create a new column for Year 

Year_Created = YEAR([Date_Created])


Use the following DAX formula:

YearPercentage =
VAR TotalCount = COUNTROWS('YourTable')
VAR YearCount = COUNTROWS(VALUES('YourTable'[Reference_Number]))
RETURN DIVIDE(YearCount, TotalCount, 0)

 

Create a new column to categorize years with less than 2% as 'Others:

DAX
YearCategory =
IF(
[YearPercentage] < 0.02,
"Others",
FORMAT([Date_Created], "yyyy")
)




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






johnt75
Super User
Super User

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.