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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Raman3456
Helper II
Helper II

Year to Year Missing User ID's

Hello Everyone,

 

I have data like the below.

Date                 User ID              Formula Required

01-12-2021          12                    Need to find December to December Missed User IDs

02-12-2022           13

03-12-2023           14

07-12-2024           17

 

If I found a user ID in the next year December then user ID, if not Blank.

 

Please help me out with the DAX formula.

 

Regards,

Raman

 

1 ACCEPTED SOLUTION
bhanu_gautam
Super User
Super User

@Raman3456 Ensure your data is in a table format, let's call it UserData.
Create a calculated column to extract the year from the date.
Create another calculated column to check if the user ID exists in the next year's December data.

 

NextYearUserID =
VAR CurrentYear = YEAR(UserData[Date])
VAR NextYear = CurrentYear + 1
VAR NextYearDecemberUserID =
CALCULATE(
MAX(UserData[User ID]),
FILTER(
UserData,
YEAR(UserData[Date]) = NextYear &&
MONTH(UserData[Date]) = 12 &&
UserData[User ID] = EARLIER(UserData[User ID])
)
)
RETURN
IF(ISBLANK(NextYearDecemberUserID), BLANK(), UserData[User ID])




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

Proud to be a Super User!




LinkedIn






View solution in original post

2 REPLIES 2
bhanu_gautam
Super User
Super User

@Raman3456 Ensure your data is in a table format, let's call it UserData.
Create a calculated column to extract the year from the date.
Create another calculated column to check if the user ID exists in the next year's December data.

 

NextYearUserID =
VAR CurrentYear = YEAR(UserData[Date])
VAR NextYear = CurrentYear + 1
VAR NextYearDecemberUserID =
CALCULATE(
MAX(UserData[User ID]),
FILTER(
UserData,
YEAR(UserData[Date]) = NextYear &&
MONTH(UserData[Date]) = 12 &&
UserData[User ID] = EARLIER(UserData[User ID])
)
)
RETURN
IF(ISBLANK(NextYearDecemberUserID), BLANK(), UserData[User ID])




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

Proud to be a Super User!




LinkedIn






Hi @Raman3456 ,

Have you resolved the issue? If yes, kindly mark the helpful answer as a solution if you feel that makes sense. Welcome to share your own solution. More people will benefit from the thread.

Should you have any further questions, feel free to reach out.
Thank you for being a part of the Microsoft Fabric Community Forum!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.