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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
PowerBI123456
Post Partisan
Post Partisan

Request user measure

Hi, need some help with a measure. I am dealing with a large model and millions of rows, so prefer to do this in a measure. I am trying to figure out who the last requester is based on a response per account. For example in the example below, the requester for account 1 is Amy and for account 2, the requester is Jerry. Thanks in advance!!

 
 
 

Capture.PNGCapture.PNG

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@PowerBI123456 , Try a measure like

 

Last Date = calculate(max(Table[user]), filter(Table, Table[Action] ="request" && Table[date] = calculate(max(Table[Date]),Table[Action] ="request", allexcept(Table, Table[Account]))) )

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

4 REPLIES 4
nvprasad
Solution Sage
Solution Sage

Hi,

 

Can you please try with the below dax measure.

 

Last_Requester =
VAR abc =
CALCULATE (
MAX ( 'Sample'[Index] ),
'Sample'[Action] = "Request",
ALLEXCEPT ( 'Sample', 'Sample'[Action], 'Sample'[Date] )
)
VAR lastuser =
LOOKUPVALUE ( 'Sample'[User], 'Sample'[Index], abc )
RETURN
lastuser
 
Lasr user dax.PNG
 

Appreciate a Kudos! 🙂
If this helps and resolves the issue, please mark it as a Solution! 🙂

Regards,
N V Durga Prasad

amitchandak
Super User
Super User

@PowerBI123456 , Try a measure like

 

Last Date = calculate(max(Table[user]), filter(Table, Table[Action] ="request" && Table[date] = calculate(max(Table[Date]),Table[Action] ="request", allexcept(Table, Table[Account]))) )

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

@amitchandak  Thanks! Anyway to incorporate the response piece? I forgot to mention, I only want to see the last request if there was a response. For example, in account 2 below, I dont want to call out the request by Tom since there was no response, only Jerry's since that was the last request before the response. Does that make sense? 

PowerBI123456_1-1612292497692.png

 

 

Hi  @PowerBI123456 ,

 

Create a measure as below:

Last Requester = 
var _responseindex=CALCULATE(MAX('Table'[Index]),FILTER(ALL('Table'),'Table'[Account]=MAX('Table'[Account])&&'Table'[Action]="Response"))
var _requestindex=CALCULATE(MAX('Table'[Index]),FILTER(ALL('Table'),'Table'[Account]=MAX('Table'[Account])&&'Table'[Index]<_responseindex&&'Table'[Action]="Request"))
Return
CALCULATE(MAX('Table'[User]),FILTER('Table','Table'[Index]=_requestindex))

And you will see:

v-kelly-msft_0-1612435993545.png

 

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

 

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!

December 2024

A Year in Review - December 2024

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