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
Henrik_99
Resolver I
Resolver I

Show value from other table outside date range

Hi

 

I'm trying to create a DAX measure / calculated column that get the value from table 1  if dates are within slicer visualization witin Power BI (relative dates) date range.

 

This works ok if category is within the date range in table 2, however if this is not the case, "Value" from Table1 is not showing for the given time period. 

 

Example Firewatcher has got value=3 (2+1) for week 45 in table1, but is not showing in fig1 under ∑ Value in Fig1. since Firewatcher is not valid for this time period.

 

Personal Category in fig1 shall refer to table 1.

 

MERGE = Category +D + Weekno + Weekday

 

I have tried lookupvalue from table 2; POB = LOOKUPVALUE(TABLE1 [VALUE];TABLE1[MERGE];TABLE2[D/N])

 

Not getting the value since Weekno is not corresponding to table 1.

 

I`m appreciate your assistance.

 

Rgds Henrik

 

 

 

Fig1.:

 

Screenshot.PNG

 

Table1

 

Table1.PNG

 

Table 2

Table2.PNG

 

 

2 REPLIES 2
v-yulgu-msft
Employee
Employee

Hi @Henrik_99,

 

This works ok if category is within the date range in table 2, however if this is not the case, "Value" from Table1 is not showing for the given time period. 

What date range should be considered in Table2?

 

Not getting the value since Weekno is not corresponding to table 1.

What do you mean "Weekno is not corresponding"? 

 

As there existing too much data fields in above table, would you please provide some dummy data that can illustrate your scenario more clearly? And show us the desired result returned by LookUp.

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Yuliana

 

Thanks for your response.

 

I would like to return values based on slicer value.

Start of week in Table 2/1 is linked to Datekey in Calendar query.

When I say "date slicer" I am referring to the visualization:

Capture.PNG

I am trying to lookup the personnel Category and return the "no of personnel" in Table 1. Personnel Category “CAT-1” should show 3 for every day as shown below --> see green value.

 

Result.PNG

 

 

 The formula I thought would work to meet the goals is following (in Table2):

VALUE = LOOKUPVALUE(TABLE1 [No of personnel];Table1[Merge];Table2[Merge])

 

 

No of personnel = 2 for Day shift and 1 for night shift for CAT-1 every day in week45.

No of personnell = 1 for Dayshift for CAT-2 every day in week45.

 

Table1.PNG

 

Table 2:

Table2.PNG

 

Merge = Personnel Category +Day/Night Shift +Weekno + Weekday

However, since CAT-1 in Table2 is not valid for Weekno 45 (only 46), no “no of personnel” is showing in the result since date slicer = Week 45.

 

CAT-1 should give 3 for each weekday as specified in Table1. Personnel Categories in Result are based on Table 1 categories.

 

Result_wrong.PNG

 

Hope it is more clearer. Thanks.

 

Pls ask if you need more info.

 

Regards

Henrik

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.