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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Anonymous
Not applicable

Dynamic URL

Hi All,

 

I have a situation where I have appended two tables and now want to create a column for Dynamic URL.

 

Below are the two URL column i created seperately for the tables.

 

 
Both the URLs were working fine seperately. 
Now I have appended the two tables and want a column with URL for both the cases.
Plz let me know the best approach I can follow for the same.
 
Regards,
Himanshu
1 ACCEPTED SOLUTION

I made an error on the previous formula "Propeller" should be followed by a comma (,) and not an equal sign (=)

Thanks,

Moiz
Was I able to answer your question? Mark my post as a solution to help others. Kudos if you liked the solution.

View solution in original post

5 REPLIES 5
moizsherwani
Continued Contributor
Continued Contributor

@Anonymous you say you have appended the two tables, but if you do so after the URL column is created then the url column should automatically be part of the appended table. 

 

If you have appended the raw tables and not created the url column, in that case you will need to either have a custom column in each table which identifies which of the two tables it is (sparkplug or propeller) or there might be a field in the existing tables which can you let you know which table the data is from.

 

Once this is done you can use something like

URL =
SWITCH (
    [Column which identifies which table the data is from],
    "SPARKPLUG",
        "https://dev.azure.com/powermatrix/Sparkplug%20R2/_workitems/edit/" & [Work Item Id],
    "PROPELLER" = "https://dev.azure.com/powermatrix/Propeller%20R2/_workitems/edit/" & [Work Item Id]
)

  

Thanks,

Moiz
Was I able to answer your question? Mark my post as a solution to help others. Kudos if you liked the solution.
Anonymous
Not applicable

@moizsherwani 

 

I have a column "Product" in my Appended query (This is a calculated column) but when using Switch function it is not giving the desired result. Data is not coming correct.

 

Himanshu_13_0-1648727332806.png

 

I want something like :

 

When 

Combine[Product]="Sparkplug" then url will be 
"https://dev.azure.com/powermatrix/Sparkplug%20R2/_workitems/edit/" & [Work Item Id]

And when 

Combine[Product]="Propeller" then url will be 

"https://dev.azure.com/powermatrix/Propeller%20R2/_workitems/edit/" & [Work Item Id]
 

@Anonymous  did you change the needed column names, does the following not work for you?

 

 

Calculated Column URL =
SWITCH (
    Combine[Product],
    "Sparkplug",
        "https://dev.azure.com/powermatrix/Sparkplug%20R2/_workitems/edit/" & Combine[Work Item Id],
    "Propeller", "https://dev.azure.com/powermatrix/Propeller%20R2/_workitems/edit/" & Combine[Work Item Id]
)

 

Thanks,

Moiz
Was I able to answer your question? Mark my post as a solution to help others. Kudos if you liked the solution.

I made an error on the previous formula "Propeller" should be followed by a comma (,) and not an equal sign (=)

Thanks,

Moiz
Was I able to answer your question? Mark my post as a solution to help others. Kudos if you liked the solution.
Anonymous
Not applicable

I actually changed the source column and it worked.

 

Thanks for the help !!!

 

Regards,

Himanshu

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.