Forum Discussion
Jcho10
10 years agoFrequent Visitor
Variable in calculate Function
Hi everybody, I'm a new user of Power BI and would like tu use variables in functions but i don't understand how it works. I would like to use this function : Part Privé N = CALCULATE( SUM...
- 10 years ago
You can use variables as following formulas. Here [Latest_Exercice] is a measure which always returns the latest date. You can also use other measures which returns a value.
This is just a sample and we need to adjust the formulas according to the actual requirement.
Measure 1:
Latest_Exercice = MAX ( Table1[Exercice] )
Measure 2:
Part Privé N = VAR Exercice = [Latest_Exercice] RETURN ( CALCULATE ( SUM ( [Solde] ), Table1[Exercice] = Exercice ) )
Best Regards,
Herbert
v-haibl-msft
10 years agoMicrosoft Employee
You can use variables as following formulas. Here [Latest_Exercice] is a measure which always returns the latest date. You can also use other measures which returns a value.
This is just a sample and we need to adjust the formulas according to the actual requirement.
Measure 1:
Latest_Exercice = MAX ( Table1[Exercice] )
Measure 2:
Part Privé N = VAR Exercice = [Latest_Exercice] RETURN ( CALCULATE ( SUM ( [Solde] ), Table1[Exercice] = Exercice ) )
Best Regards,
Herbert
- Jcho1010 years agoFrequent Visitor
HI?
Thank you for your solution. It works well !
Sincerely