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.
Sample data here. (<-- I hope that works!)
What I'm working toward is a count of householdlookupid per fundraiserlookupid and date period. Take, for example, fundraiserlookupid 0095050: Householdlookupid 0210855 was assigned to that fundraiser in date period 2016/5 - 2017/4 and stayed assigned until date period 2018/5 - 2019/4. So, for this particular combo of fundraiser and household, the desired output would be:
FundraserLookupid | DatePeriod | HouseholdCount |
0095050 | 2016/5 - 2017/4 | 1 |
0095050 | 2017/5 - 2018/4 | 1 |
0095050 | 2018/5 - 2019/4 | 1 |
One of the things I'm trying to figure out is how to assign the dateperiod in the case of the middle row above, where the householdlookupid doesn't actually show up in the data but "is there" because it's "active" during that year.'
Very much appreciate any thoughts anyone has on the matter. Thanks!
Solved! Go to Solution.
Drag the field into the visual as shown below:
Proud to be a Super User!
Try this solution.
1. Create a disconnected (no relationships) table DatePeriod:
2. Create measure:
HouseholdCount =
VAR vYearEndDate =
MAX ( DatePeriod[YearEndDate] )
VAR vResult =
CALCULATE (
COUNT ( 'sample table'[householdlookupid] ),
vYearEndDate >= 'sample table'[FromDateEvaluationYearEndDate]
&& vYearEndDate <= 'sample table'[ToDateEvaluationYearEndDate]
)
RETURN
vResult
3. Create visual using DatePeriod[DatePeriod]:
Proud to be a Super User!
Thank you so much for taking the time to look at this, @DataInsights ! I got the measure built out.
I'm unclear how I get from Step 2 to Step 3 if DatePeriod table is unrelated to [sample table].
The date logic is built into the measure, so no relationship is needed between the tables. The first two fields in the visual are from [sample table], the third field is DatePeriod[DatePeriod], and the fourth field is the measure [HouseholdCount].
Proud to be a Super User!
So if I create a table visual and add FUNDRAISERLOOKUPID and householdlookupid from [sample table], how do I add DatePeriod[DatePeriod] to that table?
Drag the field into the visual as shown below:
Proud to be a Super User!
That's expected, since there is no relationship between the tables. However, when you add the measure HouseholdCount to the visual, the issue is resolved.
Proud to be a Super User!
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 |
---|---|
49 | |
25 | |
20 | |
15 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
18 | |
18 |