The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I created a table to show current timeframe and comparison timeframe revenues. Comparison values are received when comparing 1/1/2022 through 2/14/2022 vs. 1/1/2021 through 2/14/2021 but not for 1/1/2023 through 2/14/2023 vs. 1/1/2022 through 2/14/2022. (Please see below.) I have checked my Calendar and Comparison Calendar and cannot find any errors.
The formula I used for Comparison Timeframe is
I would appreciate if anyone has an idea of where I should check next.
--------------------------------------------------------------------------------------------------------------------------
Solved! Go to Solution.
Hi @stuart765 ,
Here I create a sample to have a test.
Measure:
Comparison Timeframe =
VAR _START =
MIN ( 'Calendar'[Date] )
VAR _END =
MAX ( 'Calendar'[Date] )
VAR _PREVIOUSSTART =
DATE ( YEAR ( _START ) - 1, MONTH ( _START ), DAY ( _START ) )
VAR _PREVIOUSEND =
DATE ( YEAR ( _END ) - 1, MONTH ( _END ), DAY ( _END ) )
RETURN
CALCULATE (
[Timeframe],
FILTER (
ALL ( 'Calendar' ),
AND ( 'Calendar'[Date] >= _PREVIOUSSTART, 'Calendar'[Date] <= _PREVIOUSEND )
)
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @stuart765 ,
Here I create a sample to have a test.
Measure:
Comparison Timeframe =
VAR _START =
MIN ( 'Calendar'[Date] )
VAR _END =
MAX ( 'Calendar'[Date] )
VAR _PREVIOUSSTART =
DATE ( YEAR ( _START ) - 1, MONTH ( _START ), DAY ( _START ) )
VAR _PREVIOUSEND =
DATE ( YEAR ( _END ) - 1, MONTH ( _END ), DAY ( _END ) )
RETURN
CALCULATE (
[Timeframe],
FILTER (
ALL ( 'Calendar' ),
AND ( 'Calendar'[Date] >= _PREVIOUSSTART, 'Calendar'[Date] <= _PREVIOUSEND )
)
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.