Forum Discussion
aroldan
9 years agoFrequent Visitor
DifferentSource - HELP!
Hi everyone, Im trying to connect a data source with a parameter but no how Power BI offers. The thing is that I have two kind of client, the one who use Hana connection and the other that use SQL....
- Anonymous9 years ago
Hi aroldan,
Perhaps you can try to use below conditional query if it suitable for your requirement.
Comment: When ServerName and databaseName are null, use sql connector; if databaseName is null, use hana connector, otherwise return null.let SQLOrHana= (ServerName as text, databaseName) => let Source= if ServerName <> null and databaseName <> null then Sql.Database(ServerName,databaseName) else if databaseName = null and ServerName <> null then SapHana.Database("serverhana") else null in Source in SQLOrHanaRegards,
Xiaoxin Sheng
Anonymous
9 years agoNot applicable
Hi aroldan,
Perhaps you can try to use below conditional query if it suitable for your requirement.
Comment: When ServerName and databaseName are null, use sql connector; if databaseName is null, use hana connector, otherwise return null.
let
SQLOrHana= (ServerName as text, databaseName) =>
let
Source= if ServerName <> null and databaseName <> null
then Sql.Database(ServerName,databaseName) else
if databaseName = null and ServerName <> null then SapHana.Database("serverhana")
else null
in
Source
in
SQLOrHana
Regards,
Xiaoxin Sheng
- aroldan9 years agoFrequent Visitor
Thank you so much, that was so helpfull:smileyvery-happy: