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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Add a new filtered colum

Hi BI Community,

I have Table#1

IDProduction       IDProcess       TimeShiftBegin                TimeShiftEnd

1000                           1          2018-04-19 06:45:00       2018-04-19 08:45:00

1001                           2          2018-04-19 06:45:00       2018-04-19 08:45:00

1002                           3          2018-04-19 06:45:00       2018-04-19 08:45:00

1003                           1          2018-04-19 09:00:00       2018-04-19 11:00:00

1004                           2          2018-04-19 09:00:00       2018-04-19 11:00:00

....

 

And Table#2

ScalingID       Volume         Lenght              ScaledOn

22000                 45                 8            2018-04-19 06:45:18

22001                 45                 10          2018-04-19 06:45:43

22002                 30                 8            2018-04-19 06:46:04

 

In Table#2 I want to had Table#1[IDProduction] when ScaledOn date is between Table#1[TimeShiftBegin] and Table#1[TimeShiftEnd] and when Table#1[IDProcess] =2. Like this:

 

ScalingID       Volume         Lenght              ScaledOn                  IDProduction

22000                 45                 8            2018-04-19 06:45:18             1001

22001                 45                 10          2018-04-19 06:45:43             1001

22002                 30                 8            2018-04-19 06:46:04             1001

....

22223                 50                 9            2018-04-19 09:01:22             1004

22224                 35                 10          2018-04-19 09:01:54             1004

22225                 30                 8            2018-04-19 09:02:14             1004

          

Note that this 2 tables have nothing in common.

Thanks for your help!

FRG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @v-xjiin-msft,

I find something and it seem to work.

FilteredIDProduction2 = CALCULATE(

                                                  MAXA(Table#1[idProduction]);

                                                  FILTER(

                                                         Table#1;Table#1[TimeShiftBegin] <= (Table#2[ScaledOn]) &&

                                                          Table#1[TimeShiftEnd] >= (Table#2[ScaledOn]) &&

                                                           Table#1[idProcess] = 2

                                                                        )

                                         )

 

Thanks again

View solution in original post

3 REPLIES 3
v-xjiin-msft
Solution Sage
Solution Sage

Hi @Anonymous,

 

Try this measure:

 

Filtered IDProduction =
CALCULATE (
    MAX ( 'Table#1'[IDProduction] ),
    FILTER (
        'Table#1',
        'Table#1'[TimeShiftBegin] <= MAX ( 'Table#2'[ScaledOn] )
            && 'Table#1'[TimeShiftEnd] >= MAX ( 'Table#2'[ScaledOn] )
            && 'Table#1'[IDProcess] = 2
    )
)

7.PNG

 

Thanks,
Xi Jin.

Anonymous
Not applicable

Hi @v-xjiin-msft,

With this measure I get the same (the last) IDProduction (where IDProcess =2) for all rows in Table#2.

Thanks

FRG

 

 

Anonymous
Not applicable

Hi @v-xjiin-msft,

I find something and it seem to work.

FilteredIDProduction2 = CALCULATE(

                                                  MAXA(Table#1[idProduction]);

                                                  FILTER(

                                                         Table#1;Table#1[TimeShiftBegin] <= (Table#2[ScaledOn]) &&

                                                          Table#1[TimeShiftEnd] >= (Table#2[ScaledOn]) &&

                                                           Table#1[idProcess] = 2

                                                                        )

                                         )

 

Thanks again

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