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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors