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 am really struggling with this one - hoping some one can help me.
In short I want to count usage (engagements) based on a contract period. I have three key tables:
Table 1: Contracts
- accountid
- contractid
- contract_start_date
- contract_end_date
Table 2: Accounts
- accountid
Table 3: Engagements
- accountid
- engagementid
- engagement_date
They are joined as such:
Contracts | - | Accounts | - | Engagements |
accountid | *:1 | accountid | 1:* | accountid |
Problem:
I want to create a measure on the contracts table that will count engagements that took place ('engagement_date') during the contract period ('contract_start_date' & 'contract_end_date').
I feel like this shouldn't be that difficult but I can't seem to get this to work. I have tried a number of things, using CountRows and Filter but often the results seem to come back incomplete.
Does anyone have any suggestions on this. Thanks so much for help in advance!
Solved! Go to Solution.
@Anonymous , Try like
sumx(summarize(Accounts, Accounts[accountid], "_1", countx(filter(Engagements, Engagements[engagement_date] >= min(Contracts[contract_start_date]) && Engagements[engagement_date] <= min(Contracts[contract_start_date]) ),Engagements[engagementid])),[_1])
This worked perfectly, thank you so much Amit! You have saved me a huge headache!! Really appreciate the quick reply as well. This forum is the best 🏆
@Anonymous , Try like
sumx(summarize(Accounts, Accounts[accountid], "_1", countx(filter(Engagements, Engagements[engagement_date] >= min(Contracts[contract_start_date]) && Engagements[engagement_date] <= min(Contracts[contract_start_date]) ),Engagements[engagementid])),[_1])
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 |
---|---|
107 | |
94 | |
77 | |
63 | |
50 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |