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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
mrclay82
Helper II
Helper II

Switch date table using virtual relationship

Hi all,

 

I have a measure called [no of deliveries] which I normally use with my date table  ‘Dim-OutboundDate’

 

I need to use this measure with my other date table ‘Dim-Date’, and the outcome should be the same.

 

No matter what I try though, the outcome is different when I group it by week in the visual.

 

This is the new measure I’m trying to create:

 

CALCULATE(

    [no of deliveries],

    TREATAS(

        VALUES(

            'Dim - Date'[ID_Date]

        ),

        ‘Dim-OutboundDate’ [ID_Date]

    ))

 

Below is my data model (one to many) and I am restricted to do any physical changes with the relationships, so I need to solve this with a measure.

 

 

mrclay82_0-1692256199134.png

 

Many thanks!

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Try

My Measure =
CALCULATE (
    [no of deliveries],
    TREATAS ( VALUES ( 'Dim - Date'[ID_Date] ), 'Dim-OutboundDate'[ID_Date] ),
    REMOVEFILTERS ( 'Dim - Date' )
)

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

Try

My Measure =
CALCULATE (
    [no of deliveries],
    TREATAS ( VALUES ( 'Dim - Date'[ID_Date] ), 'Dim-OutboundDate'[ID_Date] ),
    REMOVEFILTERS ( 'Dim - Date' )
)

It worked! I am really impressed by you sir!
Many thanks!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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