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
Hey everyone - having a bit of a problem getting the data I need. Here's my data:
PersonID | DateRegistered | StartDate |
1 | 01-01-2020 | 01-01-2020 |
1 | 02-01-2020 | 03-02-2020 |
1 | 03-02-2020 | 01-01-2020 |
2 | 05-05-2020 | 08-12-2019 |
2 | 06-06-2020 | 01-01-2020 |
2 | 07-06-2020 | 03-05-2020 |
3 | 12-07-2020 | 07-10-2020 |
3 | 14-10-2020 | 01-01-2020 |
4 | 16-10-2020 | 01-01-2020 |
This table is related to my date table on DateRegistered using the date table, but I also have an inactive relation on StartDate to the date table, because I need to find out how many unique StartDate there are per month.
this is the DAX I'm using now:
Antal indskrivninger =
CALCULATE(
DISTINCTCOUNT('table'[StartDato]),
USERELATIONSHIP('table'[StartDato],Dato[Dato])
)
and it is giving me of course, a unique count of StartDate per month. So the result for the above data is 5.
BUT
What I NEED is for it to give me unique number of StartDate per PersonID - so the result for above should be:
PersonID | Number of DistinctStartDato |
1 | 2 |
2 | 3 |
3 | 2 |
4 | 1 |
and it should show me a total of 8, not 5.
Any idea how I can modify my DAX to give me the results I need?
Solved! Go to Solution.
@grggmrtn
Use your measure and modify as follows:
Antal indskrivninger =
SUMX(
SUMMARIZE(Table,Table[PersonID],Table[StartDate]),
CALCULATE(
DISTINCTCOUNT('Table'[StartDate]),
USERELATIONSHIP(Table[StartDate],Dato[Date])
)
)
________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@grggmrtn
Use your measure and modify as follows:
Antal indskrivninger =
SUMX(
SUMMARIZE(Table,Table[PersonID],Table[StartDate]),
CALCULATE(
DISTINCTCOUNT('Table'[StartDate]),
USERELATIONSHIP(Table[StartDate],Dato[Date])
)
)
________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
133 | |
91 | |
88 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
73 | |
68 |