March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I have a table that shows sales data (SalesDashboard).
I want to count the number of sales per day.
I want to do this by count distinct values per day - since each sale has a distinct order number.
I've gotten this far, but how can I count it per day instead of the overall sum?
In my data model, I have a seperate DateTable so that all days are existing.
In my table SalesDashboard, I also have a date field that's related to the DateTable.
I have looked at other posts, but I can't seem to get it to work.
Solved! Go to Solution.
Please try the below measure.
DistinctCountByDate =
CALCULATE(
SUMX(
VALUES('YourDataTable'[Date]),
CALCULATE(
DISTINCTCOUNT('YourDataTable'[Order ID])
)
)
)
Regards
Ismail
Works like a charm - thank you!
Please try the below measure.
DistinctCountByDate =
CALCULATE(
SUMX(
VALUES('YourDataTable'[Date]),
CALCULATE(
DISTINCTCOUNT('YourDataTable'[Order ID])
)
)
)
Regards
Ismail
User | Count |
---|---|
117 | |
77 | |
58 | |
52 | |
46 |
User | Count |
---|---|
171 | |
117 | |
63 | |
57 | |
51 |