Search code examples
tableau-apibi-tool

Calculation based Fixed LOD expression


I am trying to Sums the Spend based on CampaignName, campaign start date and Today's Date( today Date - 1).

Below is the Calculation Field created by me

{FIXED [CampaignName] : SUM({ FIXED
[CampaignName],[Date]>=[CampaignStartDate] AND [Date] <= [Today Date]: SUM([Spend])})}

But Calculation is show sum of all spend values in campaignName and not working for the date range that is added in the calculation field "[Date]>=[CampaignStartDate] AND [Date] <= [Today Date]".

Please Help...


Solution

  • Try this:

    {FIXED [CampaignName] : 
    SUM(If [Date]>=[CampaignStartDate] AND [Date] <= [Today Date]
    Then [Spend]
    END)}