Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi,
I need to create a custom measure that will find the distinct count of [Member ID] if [Term Date] is between the min and max of [The Date]...or if [Term Date] is later than the max of [The Date]
I have two tables:
The MembersTable, where [Member ID] and [Term Date] exist
DateTable, where [The Date] exists
I have a slicer visualization where I'm using DateTable[The Date].
This is what I came up with:
Solved! Go to Solution.
Hi, @Anonymous
You can try the following methods.
Measure =
CALCULATE (
DISTINCTCOUNT ( 'DM_IHA_Member'[Member ID] ),
FILTER (
ALL ( 'DM_IHA_Member' ),
OR (
[TermDate] >= MIN ( 'Date'[Date] )
&& [TermDate] <= MAX ( 'Date'[Date] ),
[TermDate] >= MAX ( 'Date'[Date] )
)
)
)
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I have a relationship between DateTable and MembersTable. It is using DateTable[TheDate] -> MembersTable[RunDate]
DateTable Example Data =
[TheDate]
1/1/2020
1/2/2020
1/3/2020
1/4/2020
1/5/2020
1/6/2020
1/7/2020
1/8/2020
...
...
7/20/2022
MemberTable Data Example =
[Run Date] [Member ID] [TermDate]
1/1/2020 0001 1/3/2020
1/2/2020 9988 1/7/2020
1/2/2020 5555 1/2/2020
1/2/2020 4444 10/19/2005
1/3/2020 3333 3/3/2022
1/4/2020 1111 10/10/2025
1/5/2020 2222 2/17/2021
If I had my date slicer visualization moved to 1/1/2020 to 2/10/2022...I would expect the custom measure to return a count of 6 [Member ID] because Member ID 0001, 9988, 5555, 3333, 1111, and 2222 have their [Term Date] that fall between the two slicer values OR their [Term Date] is greater than or equal to the max value of the date slicer visual
Hi, @Anonymous
You can try the following methods.
Measure =
CALCULATE (
DISTINCTCOUNT ( 'DM_IHA_Member'[Member ID] ),
FILTER (
ALL ( 'DM_IHA_Member' ),
OR (
[TermDate] >= MIN ( 'Date'[Date] )
&& [TermDate] <= MAX ( 'Date'[Date] ),
[TermDate] >= MAX ( 'Date'[Date] )
)
)
)
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I also tried this:
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
92 | |
86 | |
85 | |
66 | |
49 |
User | Count |
---|---|
140 | |
113 | |
106 | |
64 | |
60 |