Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
exp1
exp2
How can I link buttons monthly with exp1 and yearly with exp2 ? when I choose monthly i get result from exp1 and when I choose yearly I get result from exp2 ?
Assign the button actions to set a variable (lets call it vYMSelect). Yearly button sets this variable to 2, Monthly button sets it to 1.
Then use this expression:
= SUM({<DateTest = {">=$(=Date(yearStart(Today())))<=$(=Date(Today()))"}>}[Prix de vente TTC])
+ If(vYMSelect = 1,
SUM({<[Date Time] = {"<=$(=Date(yearend(Today())))>$(=Date(Today()))"}>}[CA TTC]),
SUM({<[Date Time] = {"<=$(=Date(MonthEnd(Today())))>$(=Date(Today()))"}>}[CA TTC])
)
Assign the button actions to set a variable (lets call it vYMSelect). Yearly button sets this variable to 2, Monthly button sets it to 1.
Then use this expression:
= SUM({<DateTest = {">=$(=Date(yearStart(Today())))<=$(=Date(Today()))"}>}[Prix de vente TTC])
+ If(vYMSelect = 1,
SUM({<[Date Time] = {"<=$(=Date(yearend(Today())))>$(=Date(Today()))"}>}[CA TTC]),
SUM({<[Date Time] = {"<=$(=Date(MonthEnd(Today())))>$(=Date(Today()))"}>}[CA TTC])
)
Hi, you can add a variable "vYearlyMonthlySelector", the 'Monthly' button sets its value to 'M', and the yearly button to 'Y'
Then you can use this variable value to configure your expression:
If(vYearlyMonthlySelector='M', [exp1], [exp2])
Or you can use it in conditional expression textbox.
Hope this helps.