Forum Discussion

Russ99's avatar
Russ99
Helper I
4 years ago
Solved

Custom column or measure

Hi Community,   I have a spend report (Fact Table) that shows all transactions for a year. I have supplier code, invoice number, value, entry date and date paid columns. I also have a date table fo...
  • v-yanjiang-msft's avatar
    4 years ago

    Hi Russ99 ,

    According to your description, I create a sample.

    Table:

    Supplier:

    The two tables are related with the supplier code column.

    If you want to check if the invoice number are early or late, just create a measure.

    Check =
    IF (
        MAX ( 'Table'[due date] )
            < MAX ( 'Table'[entry date] ) + MAX ( 'supplier'[payment terms] ),
        "Early",
        "Late"
    )
    

    If you want to count the number of invoice number which is early, create a measure.

    Count =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[invoice number] ),
        FILTER (
            'Table',
            'Table'[due date]
                < 'Table'[entry date] + RELATED ( 'Supplier'[payment terms] )
        )
    )
    

    Get the result.

    I attach my sample below for reference.

     

    Best Regards,
    Community Support Team _ kalyj

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