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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Ghaston
Helper I
Helper I

problem with filtring

hi 
i'm using Direct Qid_uery and i'm having a hard time filtring my date with "CALCULATE" function. 
I have a Column "ID_OF", and i want to run the result juste for the highest value of "ID_OF". 
So i created this mesure : 
g.PNG

But it didn't work. I get the result for all "ID_OF" and not the max as i wanted. 
So i put the "last_OF" variable, in a mesure : 
gf.PNG

And this mesure gave me the max value of "ID_OF" as planned. Wich is 12198 in this case. 
l.PNG
But i don't understand why it didn't work on my first formula? i changed the variable "Last_OF" with the mesure that i have just created "Last_OF", but nothing changes. 
However, i get the result that i'm expecting when i replace 'Last_OF" by it's value :12198. 
gjh.PNG

Need help please

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Ghaston,

 

Actually when you were calculating last_of in your variable that is dynamic and you provide a scenario where you are fixing a fixed value like 12198.

So in variable also you have to do same, by filtering all table data.

 

Capture.JPG 

 

Hope this will solve your problem. i have also sent you pbix file.

 

Best Regards,

Ravi

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @Ghaston

 

Could you please some temp data for it or pbix file?

 

 

Regards,

Ravi

hi @Anonymous

I'm using Direct Query, so u won't be able to open my pbix file. 
So i created for you this new one : 
https://drive.google.com/open?id=1hIOrBiDhahKZg87QaCJo5hTcDEHvJAcv

Anonymous
Not applicable

Hi @Ghaston

 

Please find the drive link for the Solution. Test.pbix.

 

 

Best Regards,

Ravi

Anonymous
Not applicable

Hi @Ghaston,

 

Actually when you were calculating last_of in your variable that is dynamic and you provide a scenario where you are fixing a fixed value like 12198.

So in variable also you have to do same, by filtering all table data.

 

Capture.JPG 

 

Hope this will solve your problem. i have also sent you pbix file.

 

Best Regards,

Ravi

hi @Anonymous

That worked perfectly!
Thanks.,
But i didn't understand why my code didn't work. Can you explain that for me please? i would appreciate it

Anonymous
Not applicable

Yeah,  Sure.

 

I have explained you above Smiley Happy

 

Once more....

See when you are calculating the "last_of" variable and putting that on card it is showing you data without any filteration. But in line chart you are using that "last_of" against the Date. Every Date has  different "last_of" value you can also verify that by putting last_of in table with date.

Actually your motive is to show total value having Ligne="ligne 68". Thats why i have calculated with all filter.

 

Regards,

Ravi

 

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.