Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Here is the appointment table I have.
I would like to add a column that shows the next appointment date. Below is how it should look like. Please give me some hints.
Solved! Go to Solution.
Hi @TonyGu ,
Does this one work for you?
Next Appointment Date = VAR _currentDate = Table[Appointment Date] RETURN CALCULATE ( MIN ( Table[Appointment Date] ), ALLEXCEPT ( Table, Table[ClientID] ), 'Table'[Appointment Date] > _currentDate )
You could also create an index to get the correct order, i.e. in Power Query, and then loop over them. Your AppointmentID might already exactly be that, then you could do something like this:
Next Appointment Date = VAR _currentIndex = Table[AppointmentID] RETURN CALCULATE ( MIN ( Table[Appointment Date] ), 'Table'[AppointmentID] = _currentIndex + 1 )
Hope this gets you closer to a solution 🙂
/Tom
https://www.instagram.com/tackytechtom
Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
Also happily accepting Kudos 🙂 |
Feel free to connect with me on LinkedIn! | |
#proudtobeasuperuser | |
Hi @TonyGu ,
Does this one work for you?
Next Appointment Date = VAR _currentDate = Table[Appointment Date] RETURN CALCULATE ( MIN ( Table[Appointment Date] ), ALLEXCEPT ( Table, Table[ClientID] ), 'Table'[Appointment Date] > _currentDate )
You could also create an index to get the correct order, i.e. in Power Query, and then loop over them. Your AppointmentID might already exactly be that, then you could do something like this:
Next Appointment Date = VAR _currentIndex = Table[AppointmentID] RETURN CALCULATE ( MIN ( Table[Appointment Date] ), 'Table'[AppointmentID] = _currentIndex + 1 )
Hope this gets you closer to a solution 🙂
/Tom
https://www.instagram.com/tackytechtom
Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
Also happily accepting Kudos 🙂 |
Feel free to connect with me on LinkedIn! | |
#proudtobeasuperuser | |
Hi Tom,
I have tried your dax and it works. Thanks a lot! Now I have another question. This time the table includes a status column. For those status is "False, I don't want to include that. The table should look like this. I wonder how to add that filter to the dax you have written.
I appreciate your help.
No worry. I figure out my self. Here is the DAX I wrote.
Awesome! Well done!
Don't forget to mark the answer to your initial question as a solution. Then it will be easier for others to find it 🙂
/Tom
https://www.instagram.com/tackytechtom
Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
Also happily accepting Kudos 🙂 |
Feel free to connect with me on LinkedIn! | |
#proudtobeasuperuser | |
Hello,
How the next column should be related to the rest of the table ?
Can't you just add the information in the source table ?
Best Regards
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
11 | |
10 | |
9 | |
8 |
User | Count |
---|---|
17 | |
12 | |
11 | |
11 | |
11 |