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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
jvandyck
Helper IV
Helper IV

transfer filter

I have a very simple report. One time dimension is linked to the fact table and one time dimension is not. I would like to transfer a slicer selection based on the unconnected time dimension (YYYYMM) to the connected time dimension (max date for the unconnected YYYYMM selection) for a YTD sales metric. I hope the solution for this question will help me for more dynamic time intelligent calculations. Thanks for your help!

ModelModel

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @jvandyck

For example, create relationships as below

4.png

add "year/month" column from "date table1" to the slicer, then create columns and measure in "fact sales" table

column

year = YEAR('fact sales'[date])

month = MONTH('fact sales'[date])

measures

seelcted_year = SELECTEDVALUE('date table1'[year])

selected_month = SELECTEDVALUE('date table1'[month])

ytd_selected =
IF (
    MAX ( [year] ) = [seelcted_year]
        && MAX ( [month] ) <= [selected_month],
    CALCULATE (
        SUM ( 'fact sales'[sales] ),
        FILTER (
            ALL ( 'fact sales' ),
            [year] = [seelcted_year]
                && [month] <= [selected_month]
                && 'fact sales'[date] <= MAX ( 'fact sales'[date] )
        )
    )
)

5.png

 

Best Regards

Maggie

 

 

Community Support Team _ Maggie Li
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

4 REPLIES 4
v-juanli-msft
Community Support
Community Support

Hi @jvandyck

For example, create relationships as below

4.png

add "year/month" column from "date table1" to the slicer, then create columns and measure in "fact sales" table

column

year = YEAR('fact sales'[date])

month = MONTH('fact sales'[date])

measures

seelcted_year = SELECTEDVALUE('date table1'[year])

selected_month = SELECTEDVALUE('date table1'[month])

ytd_selected =
IF (
    MAX ( [year] ) = [seelcted_year]
        && MAX ( [month] ) <= [selected_month],
    CALCULATE (
        SUM ( 'fact sales'[sales] ),
        FILTER (
            ALL ( 'fact sales' ),
            [year] = [seelcted_year]
                && [month] <= [selected_month]
                && 'fact sales'[date] <= MAX ( 'fact sales'[date] )
        )
    )
)

5.png

 

Best Regards

Maggie

 

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks, this works! however I do not fully grasp the logic...can you try to explain?

Also, what would be the formula if I want to show the mtd value for the selected year?

 

Many thanks again!!

v-juanli-msft
Community Support
Community Support

Hi @jvandyck

Let me confirm your requirements.

For example, when you select current year from the unconnected datetable, then the report can show current year's YTD sales and previous year's YTD sales, right?

 

Best Regards

Maggie 

I select a YYYYMM and would like to calculate the YTD up to the max date of that YYYYMM. Thanks for your help!

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors