Forum Discussion
Max Date over virtual table
Hi,
I needed to create a virtual table with a start_of_month date and cancellations. I now need to obtain in a third column the max date for start_of_month. However, I'm only getting the same date as in the start_of_month column:
Here is my virtual table / measure:
Any ideas how to always get the maximum of start_of_month in each row?
Thanks!
4 Replies
- speedrampsSuper User
We want to help you but your description is too vague. 👎
Please write it again clearly.
Please DON'T copy & paste your DAX that does not work and expect us to fathom what you want to do. That is a bit crazy. 😀
Please just give a simple non technical functional description of what you want, then let us suggest the solution. Thank you.
Provide example input data as table text (not a screen print) so we can import the data to build a solution for you.
Rename columns to user friendly names.
Also provide the example desired output, with a clear step-by-step description of calculations the process flow.
Remember not to share private data ... we don't want you to get into trouble. 😧Remove any unneeded columns which may cause confusion.
(Your devote far too much text to proudly explaining what you have got working and completely fogot to explain the problem. How should the max date of cancellations should be derived. Is there a a cancellations date you forgot to mention? What is it called? If the Augyst 2024 had 3 cancellations dated 10Aug24 and 12Aug and 15Aug24 then should the max date for August 2024 be 15Aug24? I we supposed to guess? You should try include all this infomation in the description. 🙄
Take time and care to use the same table and field names in the input, output and description so we can understand your problem and help you. 👍
Try keep it simple and ask one question per ticket.
You will get a quick response if you put time, care and effort into writing clear problem descriptions. - Bibiano_GeraldoSuper User
hi UIUser ,
I think this can help, please try it and let me know:
max_date = CALCULATE( MAX(myTable[start_of_month]), ALL(myTable) )- UIUserFrequent Visitor
Bibiano_Geraldo No it doesn't work. I can't use my virtual table in the ALL clause. It won't let me select it. I guess it's because ALL can not be used with virtual tables.
- AnonymousNot applicable
Hi UIUser ,
We recommend using the ADDCOLUMNS function combined with MAXX to calculate the maximum date directly within the virtual table context. This approach avoids the limitations of the ALL function with virtual tables.
Best regards,
Lucy Chen
Best regards,
Lucy Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.