Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have the following fliter to determine the number of students enrolled in the following periods, "Fall", "Spring" and "Summer".
VAR _enrollmentcount = CALCULATE(COUNTROWS(Enrollment),
All(Enrollment[Deposit Intent to Enroll Date/Time]),
Enrollment[Deposit Intent to Enroll Date/Time] >= _startdate
&& Enrollment[Deposit Intent to Enroll Date/Time] <= _enddate,
FILTER('Enrollment',CONTAINSSTRING('Enrollment'[Start Term and Year], _section)))
I would like to be able to updated he variable _ section with the appropriate period. I need to do this since the CONTAINSSTRING function requires quotes around the period name.
If I add the period name then the filter runs fine.
VAR _fallcount =If( _iterm = "Fall",
(CALCULATE(COUNTROWS(Enrollment),
All(Enrollment[Deposit Intent to Enroll Date/Time]),
Enrollment[Deposit Intent to Enroll Date/Time] >= _startdate
&& Enrollment[Deposit Intent to Enroll Date/Time] <= _enddate,
FILTER('Enrollment',CONTAINSSTRING('Enrollment'[Start Term and Year], "Fall"))))
)
My question is how to get quotes around the period name and how to successly implement the substution logic.
I appreciate everyones assistance.
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
11 | |
9 | |
6 |