cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AFra
Helper III
Helper III

New measure : what am I doing wrong?

Hi all, 

 

I created a measure such as : 

 
# patients = calculate(counta(Patient[Id]), year(Patient[CreationDate])=2020)
it works nicely and counts the number of new patients in 2020. 
 
however, I have another measure such as : 
Year report = 2020 
 
I'd like to remplace my # patients by : 
# patients = calculate(counta(Patient[Id]), year(Patient[CreationDate])=Year report)
 
but it doesn't work. Why? What do I have to change so it works? 
 
Thanks in advance, 
 
Ana 
 
 
1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

# patients =

var y = [Year report]

return calculate(counta(Patient[Id]), year(Patient[CreationDate])=y)

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

# patients =

var y = [Year report]

return calculate(counta(Patient[Id]), year(Patient[CreationDate])=y)

Helpful resources

Announcements
May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Submit your Data Story

Data Stories Gallery

Share your Data Story with the Community in the Data Stories Gallery.

Top Solution Authors