Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello dear Power BI-Community
Following Problem.
Le'ts assume following table
Let's say we own 4 stores in different cities.
We have data on their "result sales" and "target sales" for the year.
Let's assume we would like to adjust the "result sale" and the "target sale" about minus amounts.
For "result sale":
There are also minus amounts in other stores, but for simplicity's sake we'll just assume London.
For "target sale"
More information, because I think the problem lies in the measure's itself
Any ideas how to solve the error?
Thank you so much for your support.
Cheers
qwertzuiop
Solved! Go to Solution.
Hi @qwertzuiop ,
If you want to create two adjusted columns for both Result and Target, please try:
Adjusted_Result = IF([Result / Target]="Result", CALCULATE(SUM('Table'[Sales]),ALLEXCEPT('Table','Table'[Store]),'Table'[Result / Target]="Result")-200,0)
Adjusted_Target = IF([Result / Target]="Target", CALCULATE(SUM('Table'[Sales]),ALLEXCEPT('Table','Table'[Store]),'Table'[Result / Target]="Target")-100,0)
Or just in a single column:
Adjusted = SWITCH([Result / Target],"Result",CALCULATE(SUM('Table'[Sales]),ALLEXCEPT('Table','Table'[Store]),'Table'[Result / Target]="Result")-200,"Target",CALCULATE(SUM('Table'[Sales]),ALLEXCEPT('Table','Table'[Store]),'Table'[Result / Target]="Target")-100,0)
Output:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @qwertzuiop ,
If you want to create two adjusted columns for both Result and Target, please try:
Adjusted_Result = IF([Result / Target]="Result", CALCULATE(SUM('Table'[Sales]),ALLEXCEPT('Table','Table'[Store]),'Table'[Result / Target]="Result")-200,0)
Adjusted_Target = IF([Result / Target]="Target", CALCULATE(SUM('Table'[Sales]),ALLEXCEPT('Table','Table'[Store]),'Table'[Result / Target]="Target")-100,0)
Or just in a single column:
Adjusted = SWITCH([Result / Target],"Result",CALCULATE(SUM('Table'[Sales]),ALLEXCEPT('Table','Table'[Store]),'Table'[Result / Target]="Result")-200,"Target",CALCULATE(SUM('Table'[Sales]),ALLEXCEPT('Table','Table'[Store]),'Table'[Result / Target]="Target")-100,0)
Output:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@qwertzuiop , You can not use measure in a calculated column
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |