March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
Hi,
I have a ticketing system build on Sharepoint and reporting via PowerBI. I have two tables viz. "Ticket" and "Ticket_Status". The table "Ticket_Status" stores the day to day progress against each ticket. I need to show the last status against each ticket in the "Ticket" table which is fetched from "Ticket_Status". Refer the sample data below:-
Relationship
Ticket[ID] 1 * Ticket_Status[RefID]
Ticket[ID] (One) --> Ticket_Status[RefID] (many)
I would like to create a new column in table "Ticket" named "CurrentStatus" which should fetch the values from the field "Status" in the table "Ticket_Status" based on the maximum available "Date" value.
The RELATED function doesn`t seem to work as the relationship is the otherway round hence I have tried the LOOKUPVALUE function but with error. My formula for 'Ticket'[CurrentStatus] is as follows:- LOOKUPVALUE('Ticket_Status'[Status],'Ticket_Status'[RefID],'Ticket'[Id],'Ticket_Status'[Date],MAXA('Ticket_Status'[Date]))
The error is:- Function 'LOOKUPVALUE' does not support comparing values of type Text with values of type Integer. Consider using the VALUE or FORMAT function to convert one of the values.
Whats wrong with my formula? Is there a better way to get it done apart from the LOOKUPVALUE function?
Thanks for any help.
Regards,
Deb
Solved! Go to Solution.
Try this calculated column in table Ticket:
CurrentStatus =
VAR vMaxDate =
CALCULATE ( MAX ( Ticket_Status[Date] ), RELATEDTABLE ( Ticket_Status ) )
VAR vResult =
CALCULATE ( MAX ( Ticket_Status[Status] ), Ticket_Status[Date] = vMaxDate )
RETURN
vResult
Proud to be a Super User!
Try this calculated column in table Ticket:
CurrentStatus =
VAR vMaxDate =
CALCULATE ( MAX ( Ticket_Status[Date] ), RELATEDTABLE ( Ticket_Status ) )
VAR vResult =
CALCULATE ( MAX ( Ticket_Status[Status] ), Ticket_Status[Date] = vMaxDate )
RETURN
vResult
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
122 | |
89 | |
74 | |
59 | |
53 |
User | Count |
---|---|
196 | |
121 | |
108 | |
68 | |
65 |