Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello members,
Can someone guide me to write an expression which shows default KPI value will be for latest month. and from filter when i select another month it should show for the respective selected month.
May be try something like below:
if(isnull(GetCurrentSelections()),Date(Today(),'MMM YYYY'),[Field Name])
May be you can try below as well. Let me know if it working fine as per your requirement.
=if(isnull(GetCurrentSelections()),Date(AddMonths(Today(),0),'MMM'),GetFieldSelections(Month))
Lets assume that in a KPI, i want to show sum of sales by default for latest month and if select specific month from filter it should show the sales for that specific month.
what would be the result required if more than months get selected.
Maddineni, Assuming 'Month' is the field name for Month, 'LinesalesAmount' is field name for Sales, OrderDate is the name of the Date field. Then you can use the below Expression. Please close this as a solution if it solves your issue.
if(isnull(GetCurrentSelections()),Sum({<Month={"$(=Month(Max(OrderDate)))"}>}LineSalesAmount),
sum({<Month={'$(=GetFieldSelections(Month))'}>}LineSalesAmount))
If you want to select multiple Months at once, you can use below expression.
if(isnull(GetCurrentSelections()),Sum({<Month={"$(=Month(Max(OrderDate)))"}>}LineSalesAmount),
sum({<Month={$(=concat(DISTINCT chr(39) & Month & chr(39),','))}>}LineSalesAmount))