Forum Discussion

htbull_'s avatar
htbull_
Frequent Visitor
7 months ago
Solved

Current vs Prior Year Summation in a Measure

I am having trouble with a query that returns the value of a row for the current year correctly, but it is also placing the current year total in the previous year timeframe as well. How can it be...
  • v-hashadapu's avatar
    7 months ago

    Hi htbull_ , Thank you for reaching out to the Microsoft Community Forum.

     

    Please try this:
    Premium As Of =
    VAR AsOfDate =
    MAX ( 'Calendar_Disconnected'[Date] )
    RETURN
    CALCULATE (
    SUM ( PolicyPremium_History[USDPremiumChange] ),
    FILTER (
    ALLSELECTED ( PolicyPremium_History ),
    PolicyPremium_History[Policy Effective] <= AsOfDate &&
    PolicyPremium_History[Policy Expiration] > AsOfDate
    ),
    PolicyPremium_History[acctdate] <= AsOfDate
    )

    If it didn’t give expected output, please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot). Include all the necessary details, detailing your scenario and issue as clearly and fully as possible. Do not include sensitive information. Do not include anything that is unrelated to the issue or question. Please show the expected outcome based on the sample data you provided.

     

    Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...