Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
I have the following problem that I would love to solve in DAX.
Here is the data:
Contract DATE STATUS
C0001 06/08/2019 S0001
C0001 27/09/2019 S0002
C0004 07/09/2019 S0001
C0004 10/10/2019 S0002
Given a time range for instance August and September 2019 , I need to know the contracts that have been in S001 but got no later S0002 (within the date range). In this case solution would C0004.
Thank you for your help in advanced 🙂
The metric is per contract CXXXX and the solution would be:
Contract | Date | STATUS | Metric
C0004 | 07/09/2019 | S0001 | 1
if we get rid of contract, i should count the number of contracts that has been on S0001 but no S0002 within the time range
because its the latests row that has been on S0001 but no S0002 in the given filter range.
I have achieved the following
Hi gonzalomoran,
Did you want to get below result?
You could try below measure
Measure 2 = VAR maxd = CALCULATE ( MAX ( 'Table'[DATE] ), ALLEXCEPT ( 'Table', 'Table'[STATUS] ) ) RETURN CALCULATE ( MIN ( 'Table'[Contract] ), FILTER ( ALLEXCEPT ( 'Table', 'Table'[STATUS] ), 'Table'[DATE] = maxd ) )
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
86 | |
69 | |
66 | |
51 | |
32 |
User | Count |
---|---|
114 | |
99 | |
75 | |
65 | |
40 |