Forum Discussion

Sibrulotte's avatar
Sibrulotte
Helper IV
2 years ago
Solved

Distinct count from another table on max date

Hi,  two tables:  Balances: Date Account Amount 2024-05-27 1 10 2024-05-27 2 10 2024-05-27 3 15 2024-05-27 4 20 2024-05-27 6 50 2024-04-30 1 5 2024-04-30 2 ...
  • rajendraongole1's avatar
    2 years ago

    Hi Sibrulotte - You need to follow a structured approach to ensure that you're considering only the clients that have transactions on the maximum date without duplication

     

    Use the below measure

     

    DistinctClientCountOnMaxDate = 

    VAR MaxDateValue = [MaxDate]
    RETURN
    CALCULATE(
        DISTINCTCOUNT(Table2[Client]),
        FILTER(
            Table1,
            Table1[Date] = MaxDateValue
        )
    )
     output:
     

     

     

    can you please use the above logic and let know.

     

    Did I answer your question? Mark my post as a solution! This will help others on the forum!
    Appreciate your Kudos!!