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

Find Latest Transaction Date for Each article

So I have this Table, now I need a way to choose only the records I have marked green. The record with the latest date that is. Tabell Max Datum.png

 

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @Johan3ngholm,

 

You could create a calculated table like this:

New table_1 =
FILTER (
    'Test Data1',
    'Test Data1'[Date]
        = CALCULATE (
            MAX ( 'Test Data1'[Date] ),
            ALLEXCEPT ( 'Test Data1', 'Test Data1'[ArticleNo] )
        )
)

1.PNG

 

Best 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.

View solution in original post

3 REPLIES 3
v-yulgu-msft
Employee
Employee

Hi @Johan3ngholm,

 

You could create a calculated table like this:

New table_1 =
FILTER (
    'Test Data1',
    'Test Data1'[Date]
        = CALCULATE (
            MAX ( 'Test Data1'[Date] ),
            ALLEXCEPT ( 'Test Data1', 'Test Data1'[ArticleNo] )
        )
)

1.PNG

 

Best 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.

Thanks @v-yulgu-msft, it works, The only problem is when I have more than one transaction on the same article the same date. Then this function summerize all values that date, I only want one of the values that date. I want the lowest value that date. 

 

Power BI Turnover report more transactions same date.JPG

MFelix
Super User
Super User

Hi @Johan3ngholm,

 

The easiest way is to filter out the information on the table by max date aggregating the information, if you want to put the information on a card you need to have a measure that is something like this:

 

Total = 
CALCULATE (
    SUMX (
        SUMMARIZE (
            ALL (
                'Table'[ArticleNo];
                'Table'[DateOfMovement];
                'Table'[DateOfMovement];
                'Table'[Value]
            );
            'Table'[ArticleNo];
            "Date"; MAX ( 'Table'[DateOfMovement] );
            "TotalValue"; SUM ( 'Table'[Value] )
        );
        [TotalValue]
    )
)

See the options below:

 

max_group.gif

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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.