Forum Discussion
Value from max date
- Anonymous6 years ago
share your pbix.
and where are you adding this query
select A.* from dbo.events a
left join (select MachineID,max(EventRaised) _EVENT from dbo.[events]
Group by MachineID) b ON A.MachineID=B.MachineID AND a.EventRaised=B._EVENT
WHERE b._EVENT IS NOT NULLGet Data->Select Sql server -> ENter server name & database name->DirectQuery Mode-> Click on advance -> paste this query there ->
And load your data.
this will give you direct result set
Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar
If I resolve your problem Mark it as a solution and give kudos.
Got this error now.
A single value for column 'TagId' in table 'Events' cannot be determined....
I do not have any filters active in my filter fields.
Hi lukasjar
you have not closed bracket after tagid in return section.
Calculate(max(table[tagid]),filter())
Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar
If I resolve your problem Mark it as a solution and give kudos.
- lukasjar6 years agoResolver I
That solved it not giving an error, but still dosnt return anything =(
- Anonymous6 years agoNot applicableWhat do you mean by not returning anything?
In one your screenshot you are getting output.
Thanks
Pravin- lukasjar6 years agoResolver I
Yes that screenshot is from the code written by amitchandak pasted below.
Now this code returns on 6 of the 11 MachineId I have. I do not understand why it dosnt send anything on the other ones as it has a TagId. The measure you pasted does not work for me. Can it have something to do with my date having date + timestamp? I am looking for the last timestamp. In query editor I have filtered down the data to just include the last day.LNBV = calculate(max(Events[TagId]);filter(Events;Events[EventRaised] = lastnonblankvalue(Events[MachineId];Events[EventRaised])))