Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Dear All,
i have the following dataset:
| Id | Date | S_Cost | D_Cost | Tot_D_Cost |
| 1 | 01/01/2024 | 500 | 1500 | 3300 |
| 1 | 01/01/2024 | 500 | 1800 | 3300 |
| 1 | 03/01/2024 | 2000 | 2500 | 2500 |
| 2 | 01/02/2024 | 500 | 2100 | 3300 |
| 2 | 02/02/2024 | 500 | 2800 | 3300 |
| 2 | 10/02/2024 | 2000 | 4200 | 2500 |
Wha I need is define a MEASURE (or at least a calculated column) which splits the value of TOTAL DISTINCT S_Cost with reference to the Id and Date.
Firstly I created two measures:
| Id | Date | S_Cost | D_Cost | Tot_D_Cost | DESIRED RESULT |
| 1 | 01/01/2024 | 500 | 1500 | 3300 | 646,5517241 |
| 1 | 01/01/2024 | 500 | 1800 | 3300 | 775,862069 |
| 1 | 03/01/2024 | 2000 | 2500 | 2500 | 1077,586207 |
| 2 | 01/02/2024 | 500 | 2100 | 3300 | 692,3076923 |
| 2 | 02/02/2024 | 500 | 2800 | 3300 | 923,0769231 |
| 2 | 10/02/2024 | 2000 | 4200 | 2500 | 1384,615385 |
Wrong result:
Do you think I can adjust this final measure to reach my desired result?
Thank you a lot
Lorenzo
Hi @LorenzoC - Creating calculated columns for S_Cost and Tot_D_Cost per Id and Date
Calculated column for Total S cost distinct
Another calculated column :
create a calculated column to calculate the the distinct totals as below:
In report:
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Proud to be a Super User! | |
Dear @rajendraongole1 ,
thank you a lot for your answer. Unfortunately what you achieved is my wrong result.
What I want to achieve through a measure or a calculated column is the following (Desired Result):
| Id | Date | S_Cost | D_Cost | Tot_D_Cost | DESIRED RESULT |
| 1 | 01/01/2024 | 500 | 1500 | 3300 | 646,5517241 |
| 1 | 01/01/2024 | 500 | 1800 | 3300 | 775,862069 |
| 1 | 03/01/2024 | 2000 | 2500 | 2500 | 1077,586207 |
| 2 | 01/02/2024 | 500 | 2100 | 3300 | 692,3076923 |
| 2 | 02/02/2024 | 500 | 2800 | 3300 | 923,0769231 |
| 2 | 10/02/2024 | 2000 | 4200 | 2500 | 1384,615385 |
Hi @LorenzoC - Can you help to understand with one record how we are getting desired result 646.55 for 1 record?
| Id | Date | S_Cost | D_Cost | Tot_D_Cost | DESIRED RESULT |
| 1 | 01/01/2024 | 500 | 1500 | 3300 | 646.5517241 |
I have applied with formula dividing D_Cost by S_Cost and Tot_D_Cost as multiply.
Proud to be a Super User! | |
Dear @rajendraongole1 ,
the formula i used (in excel) for obtaining my desired result is:
(D_Cost / SUM Distinct Tot_D_Cost) * SUM_Distinct S_Cost
which in table is:
| Id | Date | S_Cost | D_Cost | Tot_D_Cost | DESIRED RESULT | Formula for DESIRED RESULT |
| 1 | 01/01/2024 | 500 | 1500 | 3300 | 646,5517241 | (1500/5800)*2500 |
| 1 | 01/01/2024 | 500 | 1800 | 3300 | 775,862069 | (1800/5800)*2500 |
| 1 | 03/01/2024 | 2000 | 2500 | 2500 | 1077,586207 | (2500/5800)*2500 |
| 2 | 01/02/2024 | 500 | 2100 | 3300 | 692,3076923 | (2100/9100)*3000 |
| 2 | 02/02/2024 | 500 | 2800 | 3300 | 923,0769231 | (2800/9100)*3000 |
| 2 | 10/02/2024 | 2000 | 4200 | 2500 | 1384,615385 | (4200/9100)*3000 |
Hello @LorenzoC ,
Can you please explain how you calculated your desired result? To have better understanding of the filter context as your explanation is not so clear in the original post.
Thank you.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 5 | |
| 4 | |
| 3 |
| User | Count |
|---|---|
| 25 | |
| 16 | |
| 8 | |
| 8 | |
| 8 |