Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Let's say you want to trend the number of distinct client ID's over time from a table of invoices.
I have an invoice table that looks like this
| Date | Client ID | Sale Amount |
| 1/1/2021 | 100 | $100 |
| 1/1/2021 | 223 | $100 |
| 1/2/2021 | 100 | $50 |
| 1/3/2021 | 270 | $100 |
| 1/3/2021 | 100 | $100 |
| 1/4/2021 | 223 | $50 |
| 1/5/2021 | 270 | $100 |
| 1/6/2021 | 400 | $100 |
| 1/6/2021 | 550 | $50 |
| 1/6/2021 | 660 | $100 |
| 1/6/2021 | 700 | $100 |
| 1/7/2021 | 100 | $50 |
And I want to produce something that looks like this
| Date | Client Count |
| 1/1/2021 | 2 |
| 1/2/2021 | 2 |
| 1/3/2021 | 3 |
| 1/4/2021 | 3 |
| 1/5/2021 | 3 |
| 1/6/2021 | 7 |
| 1/7/2021 | 7 |
I've already successfully created a table of distinct dates and I've tried to aggregate Client IDs with SUMMARIZECOLUMNS but I've only been able to show the number of distinct IDs that occur on each date.
Solved! Go to Solution.
This looks like a standard cumulative total pattern.
Client Count =
VAR CurrDate = MAX ( dimDate[Date] )
RETURN
CALCULATE ( DISTINCTCOUNT ( Table1[Client ID] ), dimDate[Date] <= CurrDate )
This looks like a standard cumulative total pattern.
Client Count =
VAR CurrDate = MAX ( dimDate[Date] )
RETURN
CALCULATE ( DISTINCTCOUNT ( Table1[Client ID] ), dimDate[Date] <= CurrDate )
You're a wizard Harry
Thank you so much for the help!!!
@mccollough you can use a measure like this
Measure =
VAR _date =
MAX ( 'Table'[Date] )
RETURN
COUNTROWS (
EXCEPT (
VALUES ( 'Table'[Client ID] ),
SUMMARIZE (
FILTER ( ALL ( 'Table' ), 'Table'[Date] < _date ),
'Table'[Client ID]
)
)
)
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 38 | |
| 36 | |
| 28 | |
| 28 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 74 | |
| 66 | |
| 65 |