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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
abatahir
Helper I
Helper I

Return a latest status in fact table

I have two tables, table1 is the fact table, tabble2 is the Status table.
Now, Table1 has a unique product ID and table2 multiple as the status and date. 
I have created the relation one to many and Cross Filter Direction BOTH, and created a Measure on Revenue Column in table1 with date filter from calender table which in relation with both tables.
Drag the Revenue measure in Matrix measure and Status from table two. the total to the matrix is correct but the breakup in from of each status is wrong. 
if download the data from visual from and do total in excel its total difference number. 


7 REPLIES 7
parry2k
Super User
Super User

@abatahir not sure what you are looking for, let me know if this is what you are expecting, some of these id's doesn't have a record in table2 and I used "**No Status Found"

 

parry2k_1-1645994702937.png

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k thank you for helping!  🙂

abatahir
Helper I
Helper I

I am sorry I did not find option for attachment. 
Table1

IDvalueSale Date
144420012-12-21
1445123901-07-21
14466025-01-21
14476005-07-21
14486014-02-21
14496027-01-22
14506022-03-21
14516013-01-22
14526024-06-21
14536014-09-21
145435418-07-21
145510107-02-22
145635410-11-21
145710114-07-21
145852514-10-21
1459103506-03-21
146038021-10-21
146138013-07-21
146277029-08-21
1463380106-05-21
146440718-11-21
1465211620-03-21
146691530-01-22

 

table2

Latest StatusIDStatus Date
Canceled144414-12-21
Canceled144503-07-21
Delivered144627-01-21
Ready To Ship144627-01-21
Shipped144627-01-21
Delivered144707-07-21
Ready To Ship144707-07-21
Shipped144707-07-21
Delivered144816-02-21
Ready To Ship144816-02-21
Shipped144816-02-21
Delivered144929-01-22
Ready To Ship144929-01-22
Shipped144929-01-22
Delivered145024-03-21
Ready To Ship145024-03-21
Shipped145024-03-21
Delivered145115-01-22
Ready To Ship145115-01-22
Shipped145115-01-22
Delivered145226-06-21
Ready To Ship145226-06-21
Shipped145226-06-21
Delivered145316-09-21
Ready To Ship145316-09-21
Shipped145316-09-21





Hi @abatahir 

Question: how do you resolve things like this?  Transaction 1447 has three different statuses on the same day. 

littlemojopuppy_0-1645981307913.png

What determines "latest"?  I assume statuses go through a progression: ready to ship, shipped, delivered.

This sample date does not show the time with date, but actually, its have time with date from the time we can filter. 

Hi @abatahir I'm stumped, mostly because I'm attempting this on three hours sleep.  😔  Calling in help from people who have forgotten more about Power BI than I ever knew.

@parry2k @mahoneypat Can you guys please try to help him out?  I'd hate to leave him hanging.  This is the approach I was taking:

  1. Determine the most recent status update for each transaction
  2. Determine the history ID number for each of those updates
  3. Apply those history ID numbers as a filter when calculating revenue

But...getting same amount for each status.

littlemojopuppy_0-1645990739290.png

The filter context is being screwed up (most likely by using ALL) but my brain is fried and haven't been able to get it right.  Hopefully I'm not too far off and you guys can help him.

littlemojopuppy
Community Champion
Community Champion

Hi @abatahir can you provide some sample data to play with?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors