Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Good Day,
I was hoping someone could assist me in a very simple(to you) query with a result return.
Scenario: I have two main columns that will contain a log of information. The one column would be Source and the second column would be destination. There is also a Master table with static information.
My question is that I want a column in PowerBI to display text based on the query result i.e.: Incoming or Outgoing.
if Data([Source], "Master[Extension]") then "Outgoing" else "Incoming"
or have two seperate columns?
if Data([Source], "Master[Extension]") then "Outgoing"
if Data([Destination], "Master[Extension]") then "Incoming"
Any assitance would be greatly appreciated,
Thank you,
Solved! Go to Solution.
@Anonymous, it helps.
Try the below DAX code in a calculated column.
Try this,
If a extension number exsits in the Usermaster and is displayed in the desination column then it would be marked as "Incoming" and if a extension number exsits in the source column then it would be "Outgoing", but if an extension matches in both columns it would be "Internal".
Please let me know if this helps? @SivaMani
@Anonymous,
You are using measure and it won't work for this code. Use the calculated column.
Refer this documentation: https://docs.microsoft.com/en-us/power-bi/transform-model/desktop-tutorial-create-calculated-columns
@SivaMani Wow, you are a Super Star.... One last question, if an extension matches the Master table and in both Data"Source" and Data"Destination" how can I make it "Internal".
Try this,
@SivaMani , Legend. Thank you. I have a whole bunch of other questions but let me try myself first prior to just posting on the forums. Thank you again.
@Anonymous
Sure. Wish you the best!
@Anonymous, it helps.
Try the below DAX code in a calculated column.
@Anonymous , Try a new column like this in DAX
new column
var _1 countx(filter(Master, Master[Extension] =Data[Source]),Data[Source])
var _2 countx(filter(Master, Master[Destination] =Data[Source]),Data[Source])
return
Switch( True() ,
not(isblank(_1)), "Outgoing",
not(isblank(_2)), "Incoming"
)
@Anonymous,
To help you with the right solution, please post your model and table structure with sample data (if possible).
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
87 | |
76 | |
74 | |
55 | |
45 |
User | Count |
---|---|
117 | |
106 | |
77 | |
66 | |
65 |