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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
AntoineTRICHET
Resolver III
Resolver III

Compare two list of string at to different dates (dynamic)

Hi everyone,

I am trying to get the difference of a list at two different date.

I have as input a table containing a field with the name of the use cases and another one containing the date.

I would like to be able to get the differences between two dates (variables) but I am struggling. The dates will be selected with slicers.
The solution I have for the moment implies the creation of 4 calculated tables and is not dynamic (take always with min and max dates without taking into consideration the slicers selection).

AntoineTRICHET_0-1629817148846.png

 

Thank you in advance for your support

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@AntoineTRICHET here it is:

 

Value Date 1 = 
VAR __selectedDate = SELECTEDVALUE(DateTable1[Date])
VAR __table = CALCULATETABLE ( VALUES ( YourTable[UseCase]  ), YourTable[Date] = __selectedDate )
RETURN
CONCATENATEX ( __table , [UseCase], "," )

Value Date 2 = 
VAR __selectedDate = SELECTEDVALUE(DateTable2[Date])
VAR __table = CALCULATETABLE ( VALUES ( YourTable[UseCase]  ), YourTable[Date] = __selectedDate )
RETURN
CONCATENATEX ( __table , [UseCase], "," )

 

Follow us on LinkedIn

 

Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

5 REPLIES 5
parry2k
Super User
Super User

@AntoineTRICHET here it is:

 

Value Date 1 = 
VAR __selectedDate = SELECTEDVALUE(DateTable1[Date])
VAR __table = CALCULATETABLE ( VALUES ( YourTable[UseCase]  ), YourTable[Date] = __selectedDate )
RETURN
CONCATENATEX ( __table , [UseCase], "," )

Value Date 2 = 
VAR __selectedDate = SELECTEDVALUE(DateTable2[Date])
VAR __table = CALCULATETABLE ( VALUES ( YourTable[UseCase]  ), YourTable[Date] = __selectedDate )
RETURN
CONCATENATEX ( __table , [UseCase], "," )

 

Follow us on LinkedIn

 

Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@AntoineTRICHET explain with an example when you have selected two dates, it returns what value? You need to explain what you are looking for, it is not very clear from your original post, 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

AntoineTRICHET_0-1629821007085.png

Please find a picture with more explanations

parry2k
Super User
Super User

@AntoineTRICHET you need to have two date tables to select the date and then add following measure:

 

Value Date 1 = 
VAR __selectedDate = SELECTEDVALUE(DateTable1[Date])
RETURN
CALCULATE ( MIN ( YourTable[UseCase] ), YourTable[Date] = __selectedDate )

Value Date 2 = 
VAR __selectedDate = SELECTEDVALUE(DateTable2[Date])
RETURN
CALCULATE ( MIN ( YourTable[UseCase] ), YourTable[Date] = __selectedDate )

 

You can add a date table by following my blog post here Create a basic Date table in your data model for Time Intelligence calculations | PeryTUS IT Solutio...

 

Follow us on LinkedIn

 

Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi @parry2k 
Thank you for your prompt answer.
I completely understand your answer. But I am not sure it will return a list of use case (type text) : I don't want the "min" value, I want to see all values. And I want to have the difference between the two results of the two measures you proposed.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors