Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
Can anyone please help me on this.
I have a date field contains the dates from 1/1/2016 to 1/1/2017.
Requirement:
When the user selects date/Month before 31st December 2017 it should executes first expression like
Sum({<Group={'Entertainment'}>}[MAINID])
When the user selects date/Month after 31st December 2017 it should executes second expression like
Sum({<Group={'Food','Clothes'}>}[MAINID])
Please suggest the solution to implement dynamically with the dates selection.
Thanks in advance.
Hi,
Something like this maybe?
Sum({<$(=IF(Max(DateField)<=vDateLimit,[Group={'Entertainment'}],[Group={'Food','Clothes'}])>} [MAINID] )
Cheers,
Luis
Perhaps this? I remind you just pay with date format
If(datefield <= '31/12/2017', Sum({<Group={'Entertainment'}>}[MAINID]), Sum({<Group={'Food','Clothes'}>}[MAINID]))
I would suggest you to create flag in the script and handle this
in the script level
if(datefield <= '31/12/2017',1,2) as Date_Flag
in the front end use this flag like this , this work for month , date selections also
if(concat(DISTINCT Date_Flag)=1,Sum({<Group={'Entertainment'}>}[MAINID]), Sum({<Group={'Food','Clothes'}>}[MAINID]))
Hi Anil,
Thanks for your reply.
Is their any way to define dynamically instead of 31/12/2017.
You could use a variable for the same and use input box to set the variable so that it would be dynamic
Of course, why not like yearend(today()).. Of not, I would ask business?
Hi,
Just wondering to know how you went about this one,
Cheers,
Luis
PS. When applicable please mark the appropriate replies as Correct. This will help community members know which discussions have already been addressed and have a possible known solution. Please mark replies as Helpful if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as Helpful if you feel additional info is useful to others