Forum Discussion
Anonymous
5 years agoNot applicable
Hi, Can you please help me below SQL statement in power BI:
Hi, Can you please help me below SQL statement in power BI: Case(i): , Top20PartNumber_cte As ( Select Top 20 eqpartnumber, Sum(Qty) As Tot_Qty, Sum(Cost) As Tot_Cost From RawData_cte Group By...
- 5 years ago
Hi, Anonymous
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table1:
Table2:
You may create a calculated column or a measure as below.
Calculated column:
Flag Column = TRIM([eqpartnumber]) in SELECTCOLUMNS( ADDCOLUMNS( Table2, "Result", TRIM(Table2[eqpartnumber]) ), "Res", [Result] )Measure:
Flag Measure = TRIM(SELECTEDVALUE(Table1[eqpartnumber])) in SELECTCOLUMNS( ADDCOLUMNS( Table2, "Result", TRIM(Table2[eqpartnumber]) ), "Res", [Result] )Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-alq-msft
Community Support
5 years agoHi, Anonymous
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table1:
Table2:
You may create a calculated column or a measure as below.
Calculated column:
Flag Column =
TRIM([eqpartnumber]) in
SELECTCOLUMNS(
ADDCOLUMNS(
Table2,
"Result",
TRIM(Table2[eqpartnumber])
),
"Res",
[Result]
)
Measure:
Flag Measure =
TRIM(SELECTEDVALUE(Table1[eqpartnumber])) in
SELECTCOLUMNS(
ADDCOLUMNS(
Table2,
"Result",
TRIM(Table2[eqpartnumber])
),
"Res",
[Result]
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.