Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have the below DAX Expressions
Count Of Overlaps =
var fromDate = MIN('VF Trade Spend'[From])
var toDate = MAX('VF Trade Spend'[To])
return CALCULATE(DISTINCTCOUNT('VF Trade Spend'[Contract Line #]),
REMOVEFILTERS('VF Trade Spend'[Contract Line #], 'VF Trade Spend'[From], 'VF Trade Spend'[To]),
FILTER('VF Trade Spend',
'VF Trade Spend'[From] >= fromDate
&& 'VF Trade Spend'[From] <= toDate
&& 'VF Trade Spend'[To] >= fromDate
&& 'VF Trade Spend'[To] <= toDate
)
)
This DAX measure is working, but it is really slow (takes 30+ seconds to complete).
The main point of what it is trying to do is we have a table that has a contract # and start and end dates on it. I'm trying to find a count of any contracts that have overlapping date ranges in them.
Solved! Go to Solution.
That is an optimization problem, I had the same problem and Marco Russo from SQLBI suggested to use this construct:
SUMX( DISTINCT ( 'VF Trade Spend'[Contract Line #] ), 1 )
Please read this article here. SQLBI: Analyzing the performance of DISTINCTCOUNT
That is an optimization problem, I had the same problem and Marco Russo from SQLBI suggested to use this construct:
SUMX( DISTINCT ( 'VF Trade Spend'[Contract Line #] ), 1 )
Please read this article here. SQLBI: Analyzing the performance of DISTINCTCOUNT
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
45 | |
25 | |
19 | |
16 | |
8 |
User | Count |
---|---|
69 | |
48 | |
44 | |
19 | |
15 |