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
gottapu
Frequent Visitor

How to Create Virtual Relationships between type 2 dimensions avoiding fact table

Hello,

 

We have a scenario where our Fact table does not hold future values. Our tabular model is set so that dimensions such as Employee, Assignments, Salary, FTE are connected to our Assignments Fact table. Assignment dimension has assignments that start in the future as well, FTE dimension has future FTE values as well and salary dimension has future salary numbers as well. We have a requriment to compare Assignments current salary, FTE with a future date salary and FTE and find out variance. This requirement is not a typical requirement as most of our reporting is done as of today or in the past.

 

Also Assignments, FTE and Salary tables are type 2 with each having their own start and end dates. We looked at TREAT AS to create a virtual relationship but the problem is there can be many entries for an assignment, for example in FTE or salary table. How can we find an entry that matches a sepecific day in future that we are looking for? For example we want to find out Assignments and their FTEs and as well as corresponding salaries for a given date in future such as 7/4/2022. 

We do have a date dimension thats connected to fact table as well that I have not shown in the attached pic.

 

Appreciate any guidance. Attached is a sample table scenario. We cannot create physical relationships between these tables as they are connected to fact table in Analysis services model. Assignments PowerBI.png

 

Thanks,

-Raj

 

 

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @gottapu ,

 

You may also try to use TREATAS function. It applies the result of a table expression as filters to columns from an unrelated table.

Icey_0-1649729978663.png

 

Best Regards,

Icey

 

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

2 REPLIES 2
Icey
Community Support
Community Support

Hi @gottapu ,

 

You may also try to use TREATAS function. It applies the result of a table expression as filters to columns from an unrelated table.

Icey_0-1649729978663.png

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@gottapu , Based on what I got so far, You can use an independent date table. Using that you can filter data in each table.

 

example

//Date1 is independent Date table,

new measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = mainx(allselected(Date1),Date1[Date])
return
calculate( sum(Table[Value]), filter('Table', 'Table'[Date] >=_min && 'Table'[Date] <=_max))

 

such measure can be show other across other common dimensions or with their own fact/dimension columns

 

same I can pass any selected value of dimension to create a measure for another dimension

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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