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

Identify Unique ids based on two month periods

I am trying to re-create  "New case" in power bi that would identify as Yes if its is the first new entry of a uniqe case ID. 

 

the Column would be as below

 

Uniqe Case ID Date LoggedCompleted DateReport MonthNew Cases
 ID12020-01-21-JanYes
 ID12020-01-21-FebNo
 ID12020-01-212020-03-22MarchNo
 ID22020-02-01-FebYes
 ID22020-02-012020-03-02MarchNo
 ID32020-03-012020-03-12MarchYes
 ID42020-01-012020-01-09JanYes

 

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi  @Anonymous 

For your case, you need add a Report Month No column in the table.

for example, you could use this formula to get it.

Report Month No = SWITCH('Table'[Report Month],
"Jan",1,
"Feb",2,
"March",3
)

2.JPG

 

Then use this formula to get the expected output column:

Result New cases = 
IF( CALCULATE(MIN('Table'[Report Month No]),FILTER('Table','Table'[Uniqe Case ID]=EARLIER('Table'[Uniqe Case ID])))='Table'[Report Month No],"Yes","No")

Result:

3.JPG

 

and here is sample pbix file, please try it

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-lili6-msft
Community Support
Community Support

hi  @Anonymous 

For your case, you need add a Report Month No column in the table.

for example, you could use this formula to get it.

Report Month No = SWITCH('Table'[Report Month],
"Jan",1,
"Feb",2,
"March",3
)

2.JPG

 

Then use this formula to get the expected output column:

Result New cases = 
IF( CALCULATE(MIN('Table'[Report Month No]),FILTER('Table','Table'[Uniqe Case ID]=EARLIER('Table'[Uniqe Case ID])))='Table'[Report Month No],"Yes","No")

Result:

3.JPG

 

and here is sample pbix file, please try it

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Pragati11
Super User
Super User

Hi @Anonymous ,

 

Your requirement is not complete as you haven't mentioned how the first new entry against a Unique Case ID is considered.

Is it based on Report Month or somehting using Date Logged and Completed Date?

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

What i am trying to capture in each report month is when the unique ID was first loggged  based on date logged.

So if it was logged in  Jan, then in report month it should identify it as a new case. where as if it was logged in in March, then the report month for March should identify it as a new case.

 

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.