Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
If possible in a measure, I am trying to determine who the requester is on a particular response based on the date.
For example, my data looks like:
Based on the data, the requester for each of 2 respones would be:
Any tips?
Solved! Go to Solution.
Hi, @PowerBI123456
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
You may go to 'Query Editor' and add an index column.
Then you may create a measure as below.
Requestor =
var maxindex =
CALCULATE(
MAX('Table'[Index]),
FILTER(
ALL('Table'),
[Date]<MAX('Table'[Date])&&
[Action]="Request"
)
)
return
IF(
MAX('Table'[Action])="Response",
MAXX(
FILTER(
ALL('Table'),
[Index]=maxindex
),
[User]
)
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @PowerBI123456
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
You may go to 'Query Editor' and add an index column.
Then you may create a measure as below.
Requestor =
var maxindex =
CALCULATE(
MAX('Table'[Index]),
FILTER(
ALL('Table'),
[Date]<MAX('Table'[Date])&&
[Action]="Request"
)
)
return
IF(
MAX('Table'[Action])="Response",
MAXX(
FILTER(
ALL('Table'),
[Index]=maxindex
),
[User]
)
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@PowerBI123456 this could be either very easy or very difficult.
How are you determining what someone is the Requestor of? Is there a ticket number or something (not included in data)? Is it sequentially...and what if the data happens to be in a different order?
Yup, there is an account number included. Yes it is sequential.
Can you provide some sample data that includes that? Because I'd hate to assume incorrectly...
@littlemojopuppy You can assume all of these have the same account number and are in sequential order.
Hi @PowerBI123456 ,
try the following custom column
Requestor =
var _date = [Date]
return
if(
[Action] = "Response",
CALCULATE(MAX('Table'[User]),TOPN(1, FILTER('Table', 'Table'[Date] < _date && [Action] = "Request"), [Date], DESC))
, BLANK()
)
Proud to be a Super User!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 63 | |
| 32 | |
| 31 | |
| 25 |