Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. 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,
Usermaster
Incoming Call
Outgoing Call
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).
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 43 | |
| 39 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 68 | |
| 63 | |
| 31 | |
| 30 | |
| 23 |