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
Canknucklehead
Helper II
Helper II

Display Last Due Date

Weird issue on my end.

 

I'm trying to get a simple table visual to display the last entry for a scheduled due date for a purchased product.

 

IE I have a list of Purchase Orders for the year. Some may be large quantities that are spread out over time. My database records all the scheduled delivery dates. I'm trying to get BI to display only the open POs and the current due date, but it either shows the previous scheduled date only or all schedule due dates, regardless of open or closed status.

 

Date Slicer is for the current Fiscal Year. I can add a second slicer for Current Fiscal Month. I get two different results, depending on if the Fiscal Month is active or not.

 

IE FY 2021 is the only active slicer:

Product X  is scheduled to arrive on March 16, April 21, May 13, October 21st.  I want only the October 21st entry to show in the table as the others have been received and are closed in the Purchase Order.

 

If FY 2021 and FM October are the active slicers:

Product X is scheduled to arrive on May 13th. (??)  The October 21st entry simply does not appear in the list if the FM slicer is active, unless I select All

 

Date Dimension has been connected to the PO Table in a couple of different ways. Originally the PO Creation date was used, and then the Scheduled Due Date. Problem persists regardless of Date connection.

 

I have an additional Status Column (Open or Closed) that I've tried to filter with, but it doesn't work because of the way our data is stored. The Product Line is still considered Open, just with several scheduled dates, so trying to filter out the Closed items simply doesn't filter out the other due dates as the Line is still Open.

 

Any suggestions on how to get this sorted? If I don't include the Scheduled Due Date in the visual, it appears to function properly. But the Purchasing Department needs to see when the next delivery is due to arrive so they can make sure that we have enough raw materials on hand to make our products.

 

 

5 REPLIES 5
Canknucklehead
Helper II
Helper II

Unfortunately, @v-eqin-msft , this solution doesn't work. I managed to sort out the issues and get rid of the error that I posted about yesterday, but applying the filters on the dashboard still will not provide the correct information.

 

For example, in our system, we have a PO open for a product. Original order quantity was 400,000+. Remaining quantity is 140,000 with 2 scheduled delivery dates - Dec 10 and Dec 23. We have received 3 shipments this month - Nov 15, 16 and 17 and these are marked CLOSED in our system.

 

The table listing OPEN POs still shows two of the Nov dates (15, 16) when the Month is set to Nov. If set to Oct, it shows all 3 Novemeber dates. If I select December, it shows me the delivery for the 10th, but for some reason also includes a Sept delivery! But not the Dec 23 delivery.

 

Any other ideas? Anyone?

 

v-eqin-msft
Community Support
Community Support

Hi @Canknucklehead ,

 

Accoring to this:

IE FY 2021 is the only active slicer:

Product X is scheduled to arrive on March 16, April 21, May 13, October 21st. I want only the October 21st entry to show in the table as the others have been received and are closed in the Purchase Order.

 

If FY 2021 and FM October are the active slicers:

Product X is scheduled to arrive on May 13th. (??) The October 21st entry simply does not appear in the list if the FM slicer is active, unless I select All

 

You need a Calendar table which will be used for slicer firstly, like this:

Calendar = ADDCOLUMNS( CALENDAR("2021/1/1","2021/12/31"),"Year",YEAR([Date]),"Month", FORMAT([Date],"mmmm"),"MonthNumber",MONTH([Date] ))

Eyelyn9_0-1634711081530.png

Then create a flag measure:

Measure = 
VAR _lastDate1 =
    CALCULATE (
        MAX ( 'Table'[Scheduled Due Date] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Vendor Name] = MAX ( 'Table'[Vendor Name] )
                && 'Table'[Part Number] = MAX ( 'Table'[Part Number] )
                && YEAR ( 'Table'[Scheduled Due Date] ) <= SELECTEDVALUE ( 'Calendar'[Year] )
        )
    )
VAR _allselectMonth =
    COUNTROWS ( ALLSELECTED ( 'Calendar'[Month] ) )
VAR _lastDate2 =
    CALCULATE (
        MAX ( 'Table'[Scheduled Due Date] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Vendor Name] = MAX ( 'Table'[Vendor Name] )
                && 'Table'[Part Number] = MAX ( 'Table'[Part Number] )
                && MONTH ( 'Table'[Scheduled Due Date] ) < MAX ( 'Calendar'[MonthNumber] )
        )
    )
RETURN
    SWITCH (
        TRUE (),
        ISFILTERED ( 'Calendar'[Month] ) = TRUE ()
            && _allselectMonth = 12, 1,
        ISFILTERED ( 'Calendar'[Month] ) = TRUE ()
            && _allselectMonth < 12
            && MAX ( 'Table'[Scheduled Due Date] ) = _lastDate2, 1,
        ISFILTERED ( 'Calendar'[Month] ) = FALSE ()
            && MAX ( 'Table'[Scheduled Due Date] ) = _lastDate1, 1
    )

After apply it to visual-filter pane, set as "is 1", the outputs are shown below:

 

1. Month slicer is inactive

Eyelyn9_1-1634711997207.png

2. Month slicer is active and select some months:

Eyelyn9_2-1634712275693.png

3. Month slicer is active and select all months:

Eyelyn9_3-1634712333755.png

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

@v-eqin-msft 

 

I've tried what you've suggested, but the measure doesn't want to work - it gives the following error: 

Canknucklehead_0-1637695491274.png

 

 

 

 

Canknucklehead
Helper II
Helper II

I am unable to supply the pbix. I can provide a table showing the information as Power BI sees it.

 

This is an actual PO in our system. 14 items from one vendor. The last two items are still "O" Open as they are not scheduled to be received until next month. 

 

If I filter out all the "C" Closed lines, the last two lines show in the visual. However, instead of showing the November due dates, it shows the Displayed Date value (In this case February). More frustratingly, it actually lists each of the items twice, the second listing showing the one March value. That is when I have only the Year slicer active. If I select a Month to show what is open for delivery in that Month, the last two line items no longer appear in the visual unless I select Feb or Mar, as it doesn't see the Nov due date for some reason.

 

As you can also see, it lists all 14 products multiple times, each with a different due date that may be active on a different line. So Product 1 is listed as having a due date of Feb, Mar, Oct and Nov. I'm not certain why PowerBI pulls in the same line item multiple times with different due dates as the master table only lists the one entry.

 

Vendor NamePO NumberPart NumberScheduled Due DateActual Due DateStatus
Vendor X12345Product 12021-02-172021-02-17C
Vendor X12345Product 22021-02-172021-02-17C
Vendor X12345Product 32021-02-172021-02-17C
Vendor X12345Product 42021-02-172021-02-17C
Vendor X12345Product 52021-02-172021-02-17C
Vendor X12345Product 62021-02-172021-02-17C
Vendor X12345Product 72021-02-172021-03-21C
Vendor X12345Product 82021-02-172021-02-17C
Vendor X12345Product 92021-02-172021-02-17C
Vendor X12345Product 102021-02-172021-07-13C
Vendor X12345Product 112021-02-172021-10-13C
Vendor X12345Product 122021-02-172021-10-18C
Vendor X12345Product 132021-02-172021-11-15O
Vendor X12345Product 142021-02-172021-11-18O
Vendor X12345Product 12021-02-17  
Vendor X12345Product 22021-03-03  
Vendor X12345Product 32021-03-03  
Vendor X12345Product 42021-03-03  
Vendor X12345Product 52021-03-03  
Vendor X12345Product 62021-03-03  
Vendor X12345Product 72021-03-03  
Vendor X12345Product 82021-03-03  
Vendor X12345Product 92021-03-03  
Vendor X12345Product 102021-03-03  
Vendor X12345Product 112021-03-03  
Vendor X12345Product 122021-03-03  
Vendor X12345Product 132021-03-03  
Vendor X12345Product 142021-03-03  
Vendor X12345Product 12021-03-03  
Vendor X12345Product 22021-03-03  
Vendor X12345Product 32021-07-13  
Vendor X12345Product 42021-07-13  
Vendor X12345Product 52021-07-13  
Vendor X12345Product 62021-07-13  
Vendor X12345Product 72021-07-13  
Vendor X12345Product 82021-07-13  
Vendor X12345Product 92021-07-13  
Vendor X12345Product 102021-07-13  
Vendor X12345Product 112021-07-13  
Vendor X12345Product 122021-07-13  
Vendor X12345Product 132021-07-13  
Vendor X12345Product 142021-07-13  
Vendor X12345Product 12021-07-13  
Vendor X12345Product 22021-07-13  
Vendor X12345Product 32021-07-13  
Vendor X12345Product 42021-10-13  
Vendor X12345Product 52021-10-13  
Vendor X12345Product 62021-10-13  
Vendor X12345Product 72021-10-13  
Vendor X12345Product 82021-10-13  
Vendor X12345Product 92021-10-13  
Vendor X12345Product 102021-10-13  
Vendor X12345Product 112021-10-13  
Vendor X12345Product 122021-10-13  
Vendor X12345Product 132021-10-13  
Vendor X12345Product 142021-10-13  
Vendor X12345Product 12021-10-13  
Vendor X12345Product 22021-10-13  
Vendor X12345Product 32021-10-13  
Vendor X12345Product 42021-10-13  
Vendor X12345Product 52021-10-18  
Vendor X12345Product 62021-10-18  
Vendor X12345Product 72021-10-18  
Vendor X12345Product 82021-10-18  
Vendor X12345Product 92021-10-18  
Vendor X12345Product 102021-10-18  
Vendor X12345Product 112021-10-18  
Vendor X12345Product 122021-10-18  
Vendor X12345Product 132021-10-18  
Vendor X12345Product 142021-10-18  
Vendor X12345Product 12021-10-18  
Vendor X12345Product 22021-10-18  
Vendor X12345Product 32021-10-18  
Vendor X12345Product 42021-10-18  
Vendor X12345Product 52021-10-18  
Vendor X12345Product 62021-10-21  
Vendor X12345Product 72021-10-21  
Vendor X12345Product 82021-10-21  
Vendor X12345Product 92021-10-21  
Vendor X12345Product 102021-10-21  
Vendor X12345Product 112021-10-21  
Vendor X12345Product 122021-10-21  
Vendor X12345Product 132021-10-21  
Vendor X12345Product 142021-10-21  
Vendor X12345Product 12021-10-21  
Vendor X12345Product 22021-10-21  
Vendor X12345Product 32021-10-21  
Vendor X12345Product 42021-10-21  
Vendor X12345Product 52021-10-21  
Vendor X12345Product 62021-10-21  
Vendor X12345Product 72021-11-15  
Vendor X12345Product 82021-11-15  
Vendor X12345Product 92021-11-15  
Vendor X12345Product 102021-11-15  
Vendor X12345Product 112021-11-15  
Vendor X12345Product 122021-11-15  
Vendor X12345Product 132021-11-15  
Vendor X12345Product 142021-11-15  
Vendor X12345Product 12021-11-15  
Vendor X12345Product 22021-11-15  
Vendor X12345Product 32021-11-15  
Vendor X12345Product 42021-11-15  
Vendor X12345Product 52021-11-15  
Vendor X12345Product 62021-11-15  
Vendor X12345Product 72021-11-15  
Vendor X12345Product 82021-11-18  
Vendor X12345Product 92021-11-18  
Vendor X12345Product 102021-11-18  
Vendor X12345Product 112021-11-18  
Vendor X12345Product 122021-11-18  
Vendor X12345Product 132021-11-18  
Vendor X12345Product 142021-11-18  
v-eqin-msft
Community Support
Community Support

Hi @Canknucklehead 

 

Please provide data sample and your expected or share your pbix file after removing sensitive data to help us clarify your scenario.

 

Refer to:

How to Get Your Question Answered Quickly - Microsoft Power BI Community

How to provide sample data in the Power BI Forum - Microsoft Power BI Community

 

Best Regards,
Eyelyn Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.