Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
stuart765
Frequent Visitor

Comparison Date Data Not Appearing

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 

CALCULATE('Rx Sold Data'[SP Revenue Timeframe],REMOVEFILTERS('Calendar'),USERELATIONSHIP('Calendar'[Date],'Comparison Calendar'[ComparisonDate]))
 

I would appreciate if anyone has an idea of where I should check next. 

 

stuart765_0-1676554693245.pngstuart765_1-1676554742785.png

--------------------------------------------------------------------------------------------------------------------------

stuart765_2-1676555630540.pngstuart765_3-1676555660293.png

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @stuart765 ,

 

Here I create a sample to have a test.

RicoZhou_0-1676883159922.png

RicoZhou_1-1676883169078.png

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.

RicoZhou_2-1676883210632.png

 

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.

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @stuart765 ,

 

Here I create a sample to have a test.

RicoZhou_0-1676883159922.png

RicoZhou_1-1676883169078.png

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.

RicoZhou_2-1676883210632.png

 

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.

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors