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
jklop195
New Member

Problem displaying data

Hi, I have this data and I'm having trouble displaying the case number.

 

I want to display the oldest assigned date and case number based on the "pending" status. I used a formula to display the oldest date with pending status but I'm having problem displaying the case number. 

Example: I can see that the oldest case date with pending status is 6/17/19 but can't display the case number in this example being (3456-17)

 

Case NumberDate AssignedStatus
3456-176/17/19Pending
4542-296/29/19Pending
6209-245/24/19Closed
6806-294/29/19Closed
7312-044/4/19Closed
1209-096/9/19Closed
8765-057/5/19Closed
2 ACCEPTED SOLUTIONS
Greg_Deckler
Super User
Super User

So, you have something like this measure?

 

Oldest Pending Date = MINX(FILTER('Cases',[Status] = "Pending"),[Date Assigned])

If you display that in a table along with this measure you should get what you need:

 

Oldest Case Number = 
VAR __min = MINX(FILTER('Cases',[Status] = "Pending"),[Date Assigned])
RETURN
MAXX(FILTER('Cases',[Date Assigned] = __min && [Status] = "Pending"),[Case Number])

 

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

Hi @jklop195 ,

By my tests, the formulas from Greg_Deckler should be helpful.

Capture.PNG

It seems that your formula is not similar to Greg_Deckler's and has syntax error.

Normally, if you use var function, we need use return to get the value.

If you still need help, please share your sample pbix so that we could help further on it.

You also could refer to my test pbix which has been attached.

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
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
Greg_Deckler
Super User
Super User

So, you have something like this measure?

 

Oldest Pending Date = MINX(FILTER('Cases',[Status] = "Pending"),[Date Assigned])

If you display that in a table along with this measure you should get what you need:

 

Oldest Case Number = 
VAR __min = MINX(FILTER('Cases',[Status] = "Pending"),[Date Assigned])
RETURN
MAXX(FILTER('Cases',[Date Assigned] = __min && [Status] = "Pending"),[Case Number])

 

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...


@Greg_Deckler wrote:

So, you have something like this measure?

 

Oldest Pending Date = MINX(FILTER('Cases',[Status] = "Pending"),[Date Assigned])

If you display that in a table along with this measure you should get what you need:

 

Oldest Case Number = 
VAR __min = MINX(FILTER('Cases',[Status] = "Pending"),[Date Assigned])
RETURN
MAXX(FILTER('Cases',[Date Assigned] = __min && [Status] = "Pending"),[Case Number])

 

 



hi,

 

I used this measure to get the oldest case;

 

Oldest Case = CALCULATE(MIN('Data'[Assigned Date]),'Data'[Status]<>"Resolved")
 
I tried what you suggested and it return with a syntax error.
 
Oldest Case Number = (DAX(var __min=minx(filter('Data',[Claim Status]<> [Resolved]),[Assigned Date])))
 
 
 
 

Hi @jklop195 ,

By my tests, the formulas from Greg_Deckler should be helpful.

Capture.PNG

It seems that your formula is not similar to Greg_Deckler's and has syntax error.

Normally, if you use var function, we need use return to get the value.

If you still need help, please share your sample pbix so that we could help further on it.

You also could refer to my test pbix which has been attached.

Best  Regards,

Cherry

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

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.