Forum Discussion
Anonymous
3 years agoNot applicable
Create a variable in PowerBI with a filter
Hello Wonderful People Please can someone point out the error in my syntax because PB error message for syntax is useless (or me?). Thank you in advance. test = Var test = CALCULATE( S...
- 3 years ago
Hi Anonymous
After Retun need to specify variable or a calculation you want to return
check the below measuretest =
Var test =
CALCULATE(
SUM('Payment Report Template'[Payment Amount]),
FILTER('Payment Report Template','Payment Report Template'[Payment Type]="Practical Completion")
)
RETURN testIf this post helps, then please consider Accept it as the solution, Appreciate your Kudos!!
Jayee
3 years agoResponsive Resident
Hi Anonymous
After Retun need to specify variable or a calculation you want to return
check the below measure
test =
Var test =
CALCULATE(
SUM('Payment Report Template'[Payment Amount]),
FILTER('Payment Report Template','Payment Report Template'[Payment Type]="Practical Completion")
)
RETURN test
If this post helps, then please consider Accept it as the solution, Appreciate your Kudos!!
- Anonymous3 years agoNot applicable
Another question:
I am trying to create a variable which contains multiple variables but the syntax contains errors that I can't tell:GFA_test =VAR pc_as20_test =CALCULATE(DISTINCTCOUNT('Weekly Report Template'[D_Code]),FILTER('Weekly Report Template', 'Weekly Report Template'[Application Stage] =" 20 Funding Agreement Signed"))VAR pc_as21_test =CALCULATE(DISTINCTCOUNT('Weekly Report Template'[D_Code]),FILTER('Weekly Report Template', 'Weekly Report Template'[Application Stage] =" 21 On Site Monitoring"))VAR pc_as22_test =CALCULATE(DISTINCTCOUNT('Weekly Report Template'[D_Code]),FILTER('Weekly Report Template', 'Weekly Report Template'[Application Stage] ="22 Practical Completion - Retention Period (12m)"))VAR pc_as23_test =CALCULATE(DISTINCTCOUNT('Weekly Report Template'[D_Code]),FILTER('Weekly Report Template','Weekly Report Template'[Application Stage] ="23 Retention Payment - Application Closed"))- Jayee3 years agoResponsive Resident
One question per ticket please. If you need to extend your request then please raise a new ticket.
You will get a quicker response and each volunteer solver will get the kudos they deserve.
Thank you !