Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello, This measure returns the number of items in the table based on the date range selected and is working as expected. I would like to create another that looks at the same timeframe but returns the value for the prior year. The point is to create two measures that allow for a comparison of the two numbers for the same timeframe for each year.
In this example I have the date range 1/1/2023 - 3/31/2023 selected. I am trying to modify the measure to return the number of items for 1/1/2022 - 3/31/2022.
* Test 4 =
var datestart =
CALCULATE(MIN('Claim Reported Date'[Calendar Date]),ALLSELECTED('Claim Reported Date'[Calendar Date]))
var dateend = CALCULATE(MAX('Claim Reported Date'[Calendar Date]),ALLSELECTED('Claim Reported Date'[Calendar Date]))
var catcount =
CALCULATE(
COUNTROWS('Claim Catastrophe'),
('Claim Catastrophe'[CAT Valid From Dt])>=datestart,
('Claim Catastrophe'[CAT Valid From Dt])<=dateend
)
Return catcount
I appreciate any help you can provide. Thanks!
Solved! Go to Solution.
Hi @jbeets ,
I think the following may do the trick:
Test 4 Last Year =
CALCULATE(
[* Test 4]
SAMEPERIODLASTYEAR( 'Claim Reported Date'[Calendar Date] )
)
It should return the value of the measure you presented but on previous year.
If I answered your question, please mark my post as a solution.
Best,
Thank you so much! This is exactly what I needed.
Hi @jbeets ,
I think the following may do the trick:
Test 4 Last Year =
CALCULATE(
[* Test 4]
SAMEPERIODLASTYEAR( 'Claim Reported Date'[Calendar Date] )
)
It should return the value of the measure you presented but on previous year.
If I answered your question, please mark my post as a solution.
Best,
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
146 | |
87 | |
66 | |
52 | |
46 |
User | Count |
---|---|
215 | |
90 | |
83 | |
66 | |
58 |