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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
rsathish_red
Frequent Visitor

DAX expression for below query

I have 5 tables. Below the attached screenshot with tables and fields.

 

table_structure.png

 

I need to display the reports details based on the User project id and partner id.

Users have two roles 'Project Role' and 'Partner Role'. I have created two Roles in the Powerbi report. One is for Partner and another role Project. 

 

Below the expression which is working in "import mode"

Partner Role: 

 

'Partner' = [partner_id] IN SELECTCOLUMNS (FILTER ( 'users', 'users'[id] = VALUE(USERNAME()) ),  "partners", [partner_id])

Project Role:

 

 

'Project' = [id] IN SELECTCOLUMNS (FILTER ( 'user_project', RELATED('users'[id]) = VALUE(USERNAME()) ),  "projects", [project_id])

 

Now we are using Direct query. I have created Analysis Service and created model. How should I write DAX Expression in Direct query for above scenario?

 

2 REPLIES 2
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @rsathish_red,

 


Can you mark the proper answer as a solution please?

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @rsathish_red,

 

It seems you added them in the tables as calculated columns. But the SSAS live mode doesn't support calculated columns. There could be two workarounds.

1. Add them in the SSAS;

2. Create a measure instead. Please give it a try. 

DAX_expression_for_below_query

 

Best Regards,

Dale

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

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.