Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello all,
I have the following scenario and I'm stumped on how to tackle it.
I have two tables like so:
I would like to sum the Sales column in Table2, only if the Percentage in Table 1 is not equal to 123 for the same Customer Number and Category.
Is this possible? I've considered merging my queries but I'm not sure how to develop a measure to sum accross columns.
Cheers,
Solved! Go to Solution.
Hi @2NV_DB ,
Please try below steps:
1. merge Table1 and Table2 in Power Query
let
Source = Table.NestedJoin(Table2, {"Customer Number"}, Table1, {"Customer Number"}, "Table1", JoinKind.Inner),
#"Expanded Table1" = Table.ExpandTableColumn(Source, "Table1", {"Customer Number", "Category", "Percentage"}, {"Table1.Customer Number", "Table1.Category", "Table1.Percentage"})
in
#"Expanded Table1"
2. create a measure with below dax formula
Conditional Sales Sum =
CALCULATE(
SUM(Table3[Sales]),
FILTER(
Table3,
Table3[Table1.Percentage] <> 123
)
)
3. add a card visual with measure
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @2NV_DB ,
Please try below steps:
1. merge Table1 and Table2 in Power Query
let
Source = Table.NestedJoin(Table2, {"Customer Number"}, Table1, {"Customer Number"}, "Table1", JoinKind.Inner),
#"Expanded Table1" = Table.ExpandTableColumn(Source, "Table1", {"Customer Number", "Category", "Percentage"}, {"Table1.Customer Number", "Table1.Category", "Table1.Percentage"})
in
#"Expanded Table1"
2. create a measure with below dax formula
Conditional Sales Sum =
CALCULATE(
SUM(Table3[Sales]),
FILTER(
Table3,
Table3[Table1.Percentage] <> 123
)
)
3. add a card visual with measure
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.