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.
I am currently creating a report that shows a cost of goods, rebated cost of goods, and true cost of goods column. The picture posted below shows the measure I created for the true cost of goods. However, the totals for the column are way off. Is there an issue with the measure I created that would be causing this problem? The totals at the bottom should be closer to the $400,000 mark and not the $152 million it is currently showing.
Solved! Go to Solution.
Hi @Celliott04 ,
I think [other_cost x qty_shipped] should be a measure, due to you can use it directly in your IF code.
I update your code, please try this.
True Cost 1=
SUMX (
SUMMARIZE (
p21_view_invoice_line,
p21_view_invoice_line[cogs_amount],
"other_cost x qty_shipped", [other_cost x qty_shipped],
"@Cost",
IF (
p21_view_invoice_line[other_cost x qty_shipped] = 0,
SELECTEDVALUE ( p21_view_invoice_line[cogs_amount] ),
p21_view_invoice_line[other_cost x qty_shipped]
)
),
[@Cost]
)
In my sample it works. Result is as below.
You can download my sample for more details.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Share the link from where i can download your PBI file.
@Celliott04 whatever columns you have on the rows, put that in the summarize:
rue Cost =
SUMX (
SUMMARIZE ( Table, Table[Column1 On Row], Table[Column 2 Row],
"@Cost", IF (
p21_view_invoice_line[other_cost x qty_shipped] = 0,
SELECTEDVALUE ( p21_view_invoice_line[cogs_amount] ),
p21_view_invoice_line[other_cost x qty_shipped]
),
[@cost]
)
Learn about conditional formatting at Microsoft Reactor
My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
I attempted to use that DAX expression below and I was getting the error, "Too few arguments were passed to the SUMX function. The minimum argument count for the function is 2."
I also put that expression into DAX formatter and was getting a syntax error. I have included that as well.
Hi @Celliott04 ,
I think [other_cost x qty_shipped] should be a measure, due to you can use it directly in your IF code.
I update your code, please try this.
True Cost 1=
SUMX (
SUMMARIZE (
p21_view_invoice_line,
p21_view_invoice_line[cogs_amount],
"other_cost x qty_shipped", [other_cost x qty_shipped],
"@Cost",
IF (
p21_view_invoice_line[other_cost x qty_shipped] = 0,
SELECTEDVALUE ( p21_view_invoice_line[cogs_amount] ),
p21_view_invoice_line[other_cost x qty_shipped]
)
),
[@Cost]
)
In my sample it works. Result is as below.
You can download my sample for more details.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Here is the measure that I am using for the column.
@Celliott04 you need to share the DAX measure expression you are using, and how the tables are connected.
Read this post to get your answer quickly.
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Learn about conditional formatting at Microsoft Reactor
My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
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 |
---|---|
106 | |
104 | |
79 | |
68 | |
61 |
User | Count |
---|---|
144 | |
104 | |
103 | |
82 | |
70 |