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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Count of Previous Case Values

Hi Everyone,

 

i have a case table connected to Case Log via Case ID and a Account/Client table connected to case via Account ID. 
case : 

CASE ID    

CASE NO   ACCOUNT ID   OTHER COLS
ASGHAS11ASDA45 
ASGHVJ12EJKN56 

Case Log :

ID                         Case ID    StartDate   EndDate    Department   Comeback
asvdsahvhsg677ASGHVJDatetimeDatetimeMCS 
sahgxsakjaw223ASGHVJ  HCD 
sdcsavbhsa677ASGHVJ  MCSYes

Account:

AccountID  Name  Location
EJKN56ALTNY
ASDA45MLTCA

 

So an account logs a Case which is registered in Case table and the workers and timing information is in Case Log.
I have the case comeback count which means how many times the case came back to the same department. I want to check the previous case registered by the same account and compare its details like comeback and time taken to solve the case for that account . How can i get the previous casenumber and [comeback count] for the all accounts??
Can I use earliers for this or something else?

Thanks for help.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

I have created a simple sample, please refer to it to see if it helps you.

Create a measure.

Measure = CALCULATE(COUNT('case log'[ID]),FILTER(ALL('case log'),'case log'[Case ID]=SELECTEDVALUE('case'[CASE NO])))

vpollymsft_0-1670390173080.png

 

Best Regards
Community Support Team _ Polly

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

6 REPLIES 6
Anonymous
Not applicable

Hi @Anonymous ,

Could you please provide more details?  What did you want to count? What is the relationships among the tables? 

 

How to Get Your Question Answered Quickly 

 

Please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

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

Anonymous
Not applicable

Hi , yes sure
[Account Table] --one to many -- [Case Table]
[Case Table] -- one to many -- [Case Log Table]
A case is logged by an account into [Case Table] and the multiple entries are made about that Case in [Case Log] Table.


I want to get is the Lastest case registered by an Account and the second last case registered by them.

Regards,

Shubham

Anonymous
Not applicable

I have a measure which gives me the no. of times the case came back to the department.

So eventually i want to
Calculate([measure], latest case) --- i.e comeback count for lastest case w.r.t account name &
Calculate([measure], second last case)-- for same account.

Hope it's clear. Appreciate any help.

thanks

Anonymous
Not applicable

Hi @Anonymous , 

What is the lateset case? How to get it? By End time or start time?  In your sample, the lateset case is ASGHVJ?  If it is, does the measure result is 3?   The below? 

asvdsahvhsg677 ASGHVJ        
sahgxsakjaw223 ASGHVJ        
sdcsavbhsa677 ASGHVJ

 

I would like you to give me a table that outputs what you want and explains the calculation method in words. Sorry to trouble you.

 

How to Get Your Question Answered Quickly 

 

Please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

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

Anonymous
Not applicable

Ahh yes, sorry for the confusion.
The [Case TABLE] has a (CreatedDate) Col. 
So i want to get the previous cases by an account i'll have to filter by date but will it give all the previous cases ? 

 

Regards,

Shubham

 

Anonymous
Not applicable

Hi @Anonymous ,

I have created a simple sample, please refer to it to see if it helps you.

Create a measure.

Measure = CALCULATE(COUNT('case log'[ID]),FILTER(ALL('case log'),'case log'[Case ID]=SELECTEDVALUE('case'[CASE NO])))

vpollymsft_0-1670390173080.png

 

Best Regards
Community Support Team _ Polly

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.