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.
Hi,
I have calculated column and I want to add target for that and get difference value. How can I do this.
Name,Open,Close and total is calculated table and Target, Difeerence column I want to add
Name | Open | Close | Total | Target | Difference |
A | 10 | 20 | 30 | 50 | 20 |
B | 5 | 6 | 11 | 60 | 49 |
C | 20 | 50 | 70 | 100 | 30 |
How can I add this and display.
Regards,
Aditya Vighne
Hi @adityavighne ,
Please provide more details to help us understand what you want.
Best Regards,
Icey
Hi @adityavighne ,
Is this problem solved?
If it is solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.
If not, please let me know.
Best Regards,
Icey
No this problem is still not solved
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Hi,
Create a seperate 2 column Table with Names in column A and targets in column B. Create a relationship from the Names in your existing table to the Names in the new 2 column table. In your existing table, write these calculated column formulas:
Targets = related(table1[Target])
Difference = [targets]-[total]
Hope this helps.
You have targets for each "Name" in a different table which you want to bring in this calculated table or you want to add the values by hard-coding them in the DAX and add it here?
@Anonymous
I want to add target for each by hard coding.
I think you should maintain your targets in a separate table, but if you want to hard-code it, you could do so as others suggested here using SWITCH. Refer to the screenshot below..
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Hi,
You can use SWITCH statement to list target as 50 for A , 100 for B , 150 for C etc. SWITCH ("ColumnA","A",50,"B",100,"C",150,0)
Regards
Rohit
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 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |