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
Join Arun Ulag at MPPC23

Join Arun Ulag at MPPC23

Get a sneak peek into this year's Power Platform Conference Keynote.

PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Top Solution Authors