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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Silvia_Wu
Regular Visitor

Map the date to a period

Hi, lovely people!

I'm looking for a solution to map a date to a period:

 

Input:

From To Sprint #
01/01/202215/01/2022Sprint 1
16/01/202230/01/2022Sprint 2
31/01/202214/02/2022Sprint 3
15/02/202201/03/2022Sprint 4
02/03/202216/03/2022Sprint 5

 

I want to map a date to get its "Sprint #", an example of the output is, for example, for the date "03/01/2022", I want to get "Sprint 1" as the output:

DateSprint
03/01/2022Sprint 1
18/01/2022Sprint 2
02/02/2022Sprint 3
17/02/2022Sprint 4
04/03/2022Sprint 5

 

I know it is possible to write "if" to get that, but because my list is very long (more than 10 "sprints" to map), I'm not sure if "if" function is a good solution.

 

Any other ways?

 

Thank you in advance!

1 ACCEPTED SOLUTION
ValtteriN
Super User
Super User

Hi,

With input data in the format you descibed you can create a mapping table e.g. by creating a list where you have dates associated with a spint. Then you can create a realtionship between this tables date and your fact tables date. Here is a good video by curbal which should help you to modify the data to a good format: https://www.youtube.com/watch?v=u3HLseZxSj4


I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
RKM
Helper IV
Helper IV

Hi @Silvia_Wu 

There are several ways. If possible I'd recommend that you do the calculation in your source view (SQL View) etc. and then pull in PBI or if that's at all not possible then you may calculate in Power BI too. Not really very expensive but depends how big you data volume is.

I can't upload files from my machine but can share a screen for you with your required look up column query. See if it helps...

Please mark as "Answered" if it solves your problem.

RKM_0-1643533713496.png

 

ValtteriN
Super User
Super User

Hi,

With input data in the format you descibed you can create a mapping table e.g. by creating a list where you have dates associated with a spint. Then you can create a realtionship between this tables date and your fact tables date. Here is a good video by curbal which should help you to modify the data to a good format: https://www.youtube.com/watch?v=u3HLseZxSj4


I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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