Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi everyone,
I'm struggling with a DAX measure and could really use some help.
Here's what I currently have:
x_CCX_Company_controlsumexlogs =
VAR Effectivecostexlogs =
CALCULATE(
SUM('FOCUS'[EffectiveCost]) -
[x_CCX_Company_Loganalytics_Shared] -
[x_CCX_company_Loganalytics_app_company]
)
RETURN
Effectivecostexlogs
This measure works as expected—it calculates the total EffectiveCost minus two other values.
What I want to do now: I need to add back [x_CCX_company_Loganalytics_app_company] only for one specific row (let's say for "Company A") in another table called x_costcenter.
All other rows should remain unaffected. The goal is to adjust the result only for that one company, without changing the overall logic for the rest.
Does this make sense? Is there a way to conditionally add that value back just for "Company A"?
Thanks in advance!
Solved! Go to Solution.
Hi Vanchief,
Thank you for your follow-up.
Please find attached the screenshot and the revised sample PBIX file for your reference. We have corrected the logic so that the amount of 2000 is now distributed proportionately across companies A, B, and C. The total increase matches the value in cell C2, which is 2000.
We trust that the information provided will help resolve the issue. Should you have any further queries, please feel free to contact the Microsoft Fabric community.
Thank you.
Hii @Vanchief
Can you please try this
x_CCX_Company_controlsumexlogs =
VAR BaseEffectiveCost =
SUM('FOCUS'[EffectiveCost])
VAR LogAnalyticsShared =
[x_CCX_Company_Loganalytics_Shared]
VAR LogAnalyticsAppCompany =
[x_CCX_company_Loganalytics_app_company]
VAR CompanyName =
SELECTEDVALUE(x_costcenter[CompanyName]) -- Adjust column name if needed
VAR AdjustedEffectiveCost =
BaseEffectiveCost - LogAnalyticsShared - LogAnalyticsAppCompany +
IF(CompanyName = "Company A", LogAnalyticsAppCompany, 0)
RETURN
AdjustedEffectiveCost
If this helps, I would appreciate your KUDOS!
Did I answer your question? Mark my post as a solution!
Proud to be Super User!!
Hi Vanchief,
Thank you for your follow-up.
Please find attached the screenshot and the revised sample PBIX file for your reference. We have corrected the logic so that the amount of 2000 is now distributed proportionately across companies A, B, and C. The total increase matches the value in cell C2, which is 2000.
We trust that the information provided will help resolve the issue. Should you have any further queries, please feel free to contact the Microsoft Fabric community.
Thank you.
This works!, I just had to modify the filter so it matches New_Costcenter -> Otherwise it adds the shared cost accumulating for every month. 🙂
Hi Vanchief,
Based on my understanding of the issue, please find attached a screenshot and a sample PBIX file that may assist in resolving the matter:
We hope the information provided helps to resolve the issue.
Should you have any further queries, kindly feel free to contact the Microsoft Fabric community.
Thank you.
It seems to calculate to every row, which is not the desired behaviour.
New_effectivecost is effectivecost minus C2 which is 2000
So I want to distribute these 2000 across company A,B,C -> However the sheet you've provided I can see that Final_Adjusted_Cost increases the companies respectly
Company A: was 1800 -> to now 4182,98 increases 2382,98
Company B: was 3600 -> to now 4365,96 increases 765,96
Company C: was 4000 -> to now 4851,06 increases 851,06
But the total increases should only match C2 which is 2000?
Hi Vanchief,
Thank you for the update.
We kindly request you to provide sample data that clearly demonstrates your issue or query in a structured format (not as an image) to help us understand and resolve the matter. Please ensure that the data is relevant, free from any sensitive information, and directly related to the issue. Additionally, please share the expected outcome based on the given example.
Thank you.
I have sample data in a powerbi, however I don't seem to be able to upload the pbix file here.
The coloumn "New_Effectivecost" is a calculated column, based on the following:
First I've created a measure that calculate the sum for resourceID C2 which is the resourceID that should be distribuated to all companies based on their total contribution in effectivecost.
So the table looks like this:
Costcenter | Chargeperiodstart | ResourceID | Effectivecost | New_Effectivecost |
Company A | 19-06-2025 02:00:00 | A1 | 300 | 300 |
Company A | 19-06-2025 02:00:00 | A2 | 500 | 500 |
Company A | 19-06-2025 02:00:00 | A3 | 1000 | 1000 |
Company B | 18-06-2025 02:00:00 | B1 | 600 | 600 |
Company B | 18-06-2025 02:00:00 | B2 | 1000 | 1000 |
Company B | 18-06-2025 02:00:00 | B3 | 2000 | 2000 |
Company C | 17-06-2025 02:00:00 | C1 | 1000 | 1000 |
Company C | 17-06-2025 02:00:00 | C2 | 2000 | 0 |
Company C | 17-06-2025 02:00:00 | C3 | 3000 | 3000 |
What I now want to recieve in my visual is a table containing:
Costcenter as rows
Chargeperiodstart(month) as columns
New_Effectivecost (sum) as values
That easy enough, however we're missing the sharedcost, so how do I readd that to all companies based on their contribution towards the total effectivecost.
*Edit*
I managed to get a anyone link to the temp file
iCloud Drive - Apple iCloud
Hi,
It will help if you share an MS Excel file with your formulas written there. This will enable me to understand your logic and translate those formulas in the DAX language.
Hi Vanchief,
We would like to follow up and see whether the details we shared have resolved your problem.
If you need any more assistance, please feel free to connect with the Microsoft Fabric community.
Thank you.
I’ve had some time to review the setup, and I don’t think my current tables can support the suggested result as-is.
I’m working with the FOCUS table, which contains a lot of data, including the key columns I’m using:
Costcenter, EffectiveCost, and ResourceID, among others.
I’ve created a new column that completely removes the shared cost. I also reallocated the cost from Company B to Company A and added a percentage measure to track each company’s cost contribution.
Now, I’d like to reintroduce the shared Log Analytics cost. However, that cost is already present in the FOCUS table, and when I try to add it back, it only appears under an empty Costcenter.
Sorry for my late reponse, I tried to create relations between the tables. But realized that I have "Duplicated" values in x_costcenter, containing (blank). So I need to modify these blank values before I am able to create relations.
Thankyou, @bhanu_gautam, for your response.
Hi Vanchief,
We appreciate your question on the Microsoft Fabric Community Forum.
Based on my understanding of the issue, we tested the scenario with a sample dataset and were able to get the expected result.
Here are the main steps we followed:
This logic adds values only for Company A and keeps the original logic for the other companies.
Please find attached the screenshot and sample PBIX file for your reference:
We hope this information helps you solve the problem.
If you have any more questions, please feel free to contact the Microsoft Fabric community.
Thank you.
@Vanchief , Try using
DAX
x_CCX_Company_controlsumexlogs =
VAR Effectivecostexlogs =
CALCULATE(
SUM('FOCUS'[EffectiveCost]) -
[x_CCX_Company_Loganalytics_Shared] -
[x_CCX_company_Loganalytics_app_company]
)
VAR AdjustedCost =
IF(
SELECTEDVALUE(x_costcenter[Company]) = "Company A",
Effectivecostexlogs + [x_CCX_company_Loganalytics_app_company],
Effectivecostexlogs
)
RETURN
AdjustedCost
Proud to be a Super User! |
|
Same issue -> nothing happens to my row company A
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
72 | |
70 | |
37 | |
29 | |
26 |
User | Count |
---|---|
91 | |
49 | |
45 | |
38 | |
37 |