The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello
I'm facing a very newbie problem
I have this table:
Selling_Price | ITEM_COST_INCL_VAT | QUANTITY_ORDERED |
16.89999962 | 16.9 | 930 |
16.95000076 | 16.9 | 200 |
7.5 | 7 | 1200 |
12 | 12.84 | 580 |
16.95000076 | 16.9 | 870 |
27 | 26.52 | 190 |
17.65999985 | 16.9 | 1420 |
7.5 | 7 | 1860 |
6.800000191 | 7 | 1360 |
7.190000057 | 7 | 1860 |
6.449999809 | 7 | 1540 |
7.5 | 7 | 1860 |
7.449999809 | 7 | 820 |
Total: 157.85 | Total: 155.96 | Total: 14690 |
I'm doing this to subtract the Selling Price - Cost Price * Quantity Ordered for each row, but instead, my measure is summing everything..
Forecasted margin (selling price incl VAT - cost incl VAT) =
VAR selling_price = SUMX(f,RELATED(dCatalog[selling_price]))
VAR cost_price_incl_vat = SUMX(f,[ITEM_COST_INCL_VAT])
VAR quantity_ordered = SUMX(f,[QUANTITY_ORDERED])
VAR margin_per_product = selling_price - cost_price_incl_vat
VAR result = margin_per_product * quantity_ordered
RETURN
result
Result that is showing my measure: 27764
Expected Result: 2800.10
How can I fix that?
Thanks
Diego
Solved! Go to Solution.
@Anonymous Well, you could make your life easy and just do this in a calculated column,
( [selling_price] - [ITEM_COST_INCL_VAT] ) * [QUANITY_ORDERED]
However, I expect that you don't just have that one table in your model but multiple tables. If that is indeed the case, then, Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
@Anonymous Well, you could make your life easy and just do this in a calculated column,
( [selling_price] - [ITEM_COST_INCL_VAT] ) * [QUANITY_ORDERED]
However, I expect that you don't just have that one table in your model but multiple tables. If that is indeed the case, then, Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
User | Count |
---|---|
26 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
32 | |
13 | |
10 | |
10 | |
9 |