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

Is it possible to integrate the constant DAX expression into Power BI

Hello, everyone,

I have the following request.

 

I have sales (Sales Invoice Line) per salesperson.

Salesperson has specific goals (Target). Such as Amount in a specific city or Amount to a specific customer.

 

I would like to maintain the targets for each salesperson in the target table, including the DAX expression.

 

Is it possible to integrate the constant DAX expression from Excel (Column "DAX Filter" in "Target" table) into Power BI?

So that I don't have to create a measure per city, but only one measure "Amount City"

 

Something like this:

New Measure:

Amount City = [DAX Filter]

 

My data model:

denxx34_1-1645538908728.png

 

 

Output:

denxx34_0-1645538866212.png

Sample Data:

 

Target

CodeTypePlanDAX FilterPlannedYear
JRAmount with Customer + DAXAmount in CityCALCULATE( [Sum of Amount] , FILTER('Sales Invoice Line' , 'Sales Invoice Line'[City] = "München" ) )100002010
AHAmount with Customer + DAXAmount in CityCALCULATE( [Sum of Amount] , FILTER('Sales Invoice Line' , 'Sales Invoice Line'[City] = "Frankfurt a. M." ) )2002010
PSAmount with Customer + DAXAmount with CustomerCALCULATE( [Sum of Amount] , FILTER('Sales Invoice Line' , 'Sales Invoice Line'[Sell-to Customer No_] = "40000" ) )15002010
AHCount ofCount of Order in Suisse 252010
JRCount ofCount of Order in Austria 202010
JRCount ofCount of Customers in Austria 502010

 

Sales Invoice Line

Document No_Line No_Sell-to Customer No_No_AmountQuantitySalesperson CodePosting DateCity
10301910000400008908-W530,43PS13.12.2010Berlin
10301920000400008916-W579,62PS13.12.2010Berlin
10301930000400008924-W536,31PS13.12.2010Berlin
VRG1001168400001130001996-S2780,462JR07.06.2010München
VRG1001328200001130001928-W1049,182JR28.06.2010München
VRG1000746200001130001960-S383,52JR12.04.2010München
VRG1001382100001130001928-W1049,182JR05.07.2010München
VRG1001434700001130001984-W1494,781JR12.07.2010München
VRG1001434600001130001980-S189,111JR12.07.2010München
VRG1002255300001290001968-W1494,781JR01.11.2010München
VRG1002255200001290001960-S191,751JR01.11.2010München
VRG1002497200001290001928-S54,521JR06.12.2010München
VRG1002255100001290001896-S995,741JR01.11.2010München
VRG1002497100001290001908-S189,111JR06.12.2010München
VRG1002498100001270001908-S2343GD06.12.2009Stuttgart
VRG1008498100001270001908-W289,132VR06.11.2009Stuttgart
VRG1002454100001250001908-S2343AH06.12.2010München
VRG1001455100001140001980-S169,111JR12.07.2010Heilbronn
VRG100221910000122001968-W1794,781JR01.11.2010Heilbronn
VRG1002875100001290001908-S2894AH06.10.2010Frankfurt a. M.

 

I thank you in advance!

 
 
 
 
 
4 REPLIES 4
v-janeyg-msft
Community Support
Community Support

@denxx34  Hello

 

Any updates? Do you still need help?

v-janeyg-msft
Community Support
Community Support

Hi, @denxx34 

 

According to the data you have provided, If there are not many types of cities, it is recommended to write measures separately, because your data is more complex.

vjaneygmsft_1-1645780286157.png

E.g: I see that a sales person in your data may sell more than one city, how to deal with this situation?

 

Best Regards,

Community Support Team _Janey

 

amitchandak
Super User
Super User

@denxx34 , You need to have target table, salesperson, city and date(month/year etc)  and that need join with column tables like salesperson, city, and date. same is true sales invoice table

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

Thanks for your answer, but I don't quite understand what you mean. Can you please explain it in a little more detail?

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.