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
powerbighy
Frequent Visitor

I have two tables. how to lookup value in sequence .

Dear all ,

 

I have two tables.

The first one is for demand qty with a request date

The second one is for available items.

I want the result just like the values in the third table.

 

 

powerbighy_0-1660216261051.png

 

powerbighy_1-1660216295641.png

powerbighy_2-1660216616090.png

 

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Create a Calendar Table with a relationship (Many to One and Single) from the Date column of Table2 to the Date column of the Calendar Table.  Create a single column Item table with a relationship (Many to One and Single) from the Item column of both tables to the single column Item Table.  To your visual, drag Date from the Calendar Table and Item from the single column Item table.  Drag SN from Table2.  Write this measure

Measure = countrows(Table2)

Hope this helps.


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

View solution in original post

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

Create a Calendar Table with a relationship (Many to One and Single) from the Date column of Table2 to the Date column of the Calendar Table.  Create a single column Item table with a relationship (Many to One and Single) from the Item column of both tables to the single column Item Table.  To your visual, drag Date from the Calendar Table and Item from the single column Item table.  Drag SN from Table2.  Write this measure

Measure = countrows(Table2)

Hope this helps.


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

Hi Ashish ,

Thanks a lot for your reply and solution.

Though,May i ask what is the Measure= countrows(Table2) for?

and for this "Create a Calendar Table with a relationship (Many to One and Single) from the Date column of Table2"      There is no date value in table 2.

Could you please provide more details?

THanks.

You are welcome.  That will allow you to see the relevant SN's for each id.  I meant Table1


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

Dear Ashish

Thanks a lot.

I model the data according to your method ,though I cannot get the right result. 

I have no idea if I understand you fully.

Could you please help to double-check?

powerbighy_6-1660533479504.png

 

 
 
 
 

powerbighy_5-1660533462450.png

 

 

Hi,

I cannot help without looking at your PBI file.  Share the download link of your PBI file and show the expected result.


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

Please provide sanitized sample data that fully covers your issue. I can only help you with meaningful sample data.
Please paste the data into a table in your post or use one of the file services like OneDrive or Google Drive. Screenshots of your source data are not useful.
Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

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.

Top Solution Authors