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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
yephome_phoenix
Frequent Visitor

Need help with DAX that extract the name of properties in the same postcode

Hi guys, I need some help with creating a DAX function to retract all the project names.

The data model is shown below like this:

PowerBI Question.PNG

  • Companies can build a project, and each project can have multiple properties.
  • Project_status and project_type are just two dimensional-tables that describe the details.

For the dashboard:

  • It has two filters on all pages:                                                    
    1. The company name: The company name has been set as default. 
    2.  Project status: Select active projects only.
  • The dashboard report is company-orientated. That means there is a slicer that shows all the projects that belong to the default company.
  • When a project is selected, the post-code of the project will be displayed as well.

The dashboard looks like this:

Capture 1.PNG

Need help with: 

I am having difficulties writing a DAX to extract a list(column) of all the project names in the same postcode.

The DAX should overwrite the existing report-level filters so that all companies' projects can be shown in the list/column. As long as the project is located within the post-code, it will be shown.

 

The DAX function I came up with is not working as expected, and I've been struggling with this question for days. Your help would be really appreciated. 


The DAX I wrote:
surrounding projects = CALCULATETABLE(values('project'[name]),FILTER('project', 'project'[post_code] = [current post code]) , 'project'[status] = 1)
 
This DAX is wrong, but I do not understand the reason. Please help : (
1 ACCEPTED SOLUTION
v-chenwuz-msft
Community Support
Community Support

Hi @yephome_phoenix ,

 

OK, you want a list of all the project name which company is localed in the post-code ignore page-level filter.

 

surrounding projects = CALCULATETABLE(values('project'[name]),FILTER(All('project')'project'[post_code] = [current post code]) , 'project'[status] = 1)

 

If you want keep some filter on the page-level, for example, project status. Then ALLEXCEPT('project', porject[status])

 

Best Regards

Community Support Team _ chenwu zhu

 

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
v-chenwuz-msft
Community Support
Community Support

Hi @yephome_phoenix ,

 

OK, you want a list of all the project name which company is localed in the post-code ignore page-level filter.

 

surrounding projects = CALCULATETABLE(values('project'[name]),FILTER(All('project')'project'[post_code] = [current post code]) , 'project'[status] = 1)

 

If you want keep some filter on the page-level, for example, project status. Then ALLEXCEPT('project', porject[status])

 

Best Regards

Community Support Team _ chenwu zhu

 

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

yephome_phoenix
Frequent Visitor

can someone please help : (

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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