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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Joe_Grosskopf
Helper II
Helper II

Need to calculate latest entry for a day on a customer

We have quotes to customers updated many times a day. I'm trying to get a table that shows the latest update for each customer for each day. I managed to get a table that shows me the latest update for each day but NOT for each customer for each day. Just need to add another grouping or filter but don't know how... This is what I have for the table:

 

Latest_Opp_Amount_for_Day =
FILTER (
    'Opportunity History',
    VAR day_ =
        DATEVALUE ( 'Opportunity History'[CreatedDate] )
    VAR latest_ =
        CALCULATE (
            MAX ( 'Opportunity History'[CreatedDate] ),
            DATEVALUE ( 'Opportunity History'[CreatedDate] ) = day_,
            ALLEXCEPT ( 'Opportunity History', 'Opportunity History'[CreatedDate])
        )
    RETURN
        latest_ = 'Opportunity History'[CreatedDate]
)
 
And no errors, just just shows me the latest entry for that day. If there was a column called customer ID, how would I add it to show me the latest entry for the customer for that day?
2 REPLIES 2
Joe_Grosskopf
Helper II
Helper II

 Thank ou for the reply...the issue is the customer id is in a table other than datetable and I cannot seem to find how to add another allexcept when doing two tables. I have tried

 

Measure = calculate(sum('Opportunity'[Amount]),allexcept(
                                                    DateTable,
                                                    'DateTable'[Year-Day]
                                                        ),
                                                allexcept(
                                                    'Opportunity History',
                                                    'Opportunity History'[ID]
                                                ))
 
But it is not working
lukiz84
Memorable Member
Memorable Member

Add the customer to ALLEXCEPT

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.