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
Portrek
Resolver III
Resolver III

Custon Column - bring a value the another table based in paramter dates in power query

Hello guys. I have a question, can you help me.

 

I want to create a new customized column in the data table (image 1) that brings me the relative values of the Group table, column ID GROUPS, (image2) considering the appropriate parameter of the dates ..

 

For example: If the date of the data table - (Image 1) is between the start date and the end date of the groups table (Image2) will bring me the value corresponding to the ID_Group of the group column of the data table.

 

IM1.pngIM2.png

 

Thank you in advance for your help.

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Enter this calculated column formula in DATAS table

=calculate(sum(Group[idgroup]),filter(group,group[group]=earlier(datas[group])&&group([data inicio])<=earlier(datas[data])&&group([data inicio])>=earlier(datas[data])))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

5 REPLIES 5
Ashish_Mathur
Super User
Super User

Hi,

Enter this calculated column formula in DATAS table

=calculate(sum(Group[idgroup]),filter(group,group[group]=earlier(datas[group])&&group([data inicio])<=earlier(datas[data])&&group([data inicio])>=earlier(datas[data])))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Ashish, Do you know Is there any way to do this within the power query?

Hi,

No.  Not an efficient way.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thank you!

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.