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.
Unfortunatly still not working.
The first two are working on a imported query, not on direct query.
The third solution you suggested I get an error message, pic below.
Hi lukasjar
I have created your datset on sql server and created directQUery.
The above two measure are showing same result which i was getting using import.
DO one thing create new pbix file and check.
Measures are working fine with directquery and yah i need to look onto column issue.
Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar
If I resolve your problem Mark it as a solution and give kudos.
- Anonymous6 years agoNot applicable
hI lukasjar
Use below query while connecting to your datasource using directquery.
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 NULLI have given you some measures in last post if you want your output using measures.
There are some limitation while creating Calculated column when source is directquery.
Hence calculate,Allexcept,filter and earlier are not working in previous formula.
Check it out here
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
I do not understand why it is not working on my end then, but must be something wrong in what I am doing i guess.
I have done a new pbix file with a new query as you wrote in the second message. Still have the same result. Will try sending you a movie of the pbix and measurments.
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 NULL - Anonymous6 years agoNot applicable
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.