Forum Discussion
Current vs Prior Year Summation in a Measure
- 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-...
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-...
I made a couple of slight modifications on my end, but this worked nicely. Thank you!