Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Customer Part | Supplier Part | Line Type | Totals | Expected |
CPart A | Customer Demand | 12345 | Empty | |
CPart A | SPartY | Supplier Order | 56 | 12345 |
CPart D | SPartX | Supplier Order | 56 | Empty |
CPart B | Customer Demand | 5869 | Empty | |
CPart E | SPartN | Supplier Order | 25 | Empty |
CPart B | SPartO | Supplier Order | 66 | 5689 |
In Expected column, I would like to bring Totals from Customer Demand when the Customer Part Number matches Customer Part No in the Supplier Order field.
Therefore, the lookup will be only based on Customer Part Number but the data will only come from the Customer Demand row. it is more like of multi filter.
Solved! Go to Solution.
Hi, @lotus22
"Type 2" is a calculated column ,so it cannot be found in Power Query.
You can try create a calculated column as below:
Column =
var a=CALCULATE(SUM('Table'[Totals]),ALLEXCEPT('Table','Table'[Customer Part]),'Table'[Type]="Customer Demand")
return IF('Table'[Type]="Customer Demand",BLANK(),a)
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @lotus22 ,
You can create a custom column like this:
if [Line Type] = "Supplier Order" then
let
_customerPart = [Customer Part],
_rows = Table.SelectRows(#"Changed Type", each [Customer Part] = _customerPart and [Line Type] = "Customer Demand")
in
if Table.IsEmpty(_rows) then null
else _rows[Totals]{0}
else null
error received
Expression.Error: The field 'Type2' of the record wasn't found.
Type2 is a calculated column
Hi, @lotus22
"Type 2" is a calculated column ,so it cannot be found in Power Query.
You can try create a calculated column as below:
Column =
var a=CALCULATE(SUM('Table'[Totals]),ALLEXCEPT('Table','Table'[Customer Part]),'Table'[Type]="Customer Demand")
return IF('Table'[Type]="Customer Demand",BLANK(),a)
Best Regards,
Community Support Team _ Eason
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you, but i see all "null" when I incorporate same formula. I have about 30 columns in my power query
if [Type2] = "Supplier Order" then
let
_customerPart = [CustomerPart],
_rows = Table.SelectRows(#"Changed Type", each [CustomerPart] = _customerPart and [Type2] = "Customer Demand")
in
if Table.IsEmpty(_rows) then null
else _rows[Totals]{0}
else null
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
143 | |
85 | |
66 | |
51 | |
45 |
User | Count |
---|---|
216 | |
89 | |
82 | |
66 | |
57 |