Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
aroldan
Frequent 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.

What Im trying to do is something like this:

 

-Create Source Parameters for each one

 

    SQLSource = Sql.Database("server","bd")

    HANASource = SapHana.Database("serverhana")

 

-One parameter to point one of them

    ConnectionSource = SQLSource

    or

    ConnectionSource = HANASource

 

-Finally get this

 

    Source = ConnectionSource

 

Why I'm trying to do this? because I want to avoid to have two reports/forms one for each kind of client.

There's any way to make it?

 

Thanks for your time Smiley Very Happy

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Thank you so much, that was so helpfullSmiley Very Happy

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.