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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
tksnota
Post Patron
Post Patron

Merge Visuals Containing Different Currencies

Hi,

 

I have 2 different visuals using different tables as shown. 


I want to merge them into one but my problem is their currencies are different so when the user moved from one account to another  it must show the right currency.

 

Thanks...tksnota

 

 

tksnota_1-1737453440516.png

 

 

tksnota_4-1737453746499.png

 

 

 

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @tksnota 

 

This is why dimension tables are essential. Directly linking two fact tables isn't ideal because they often have different columns or column values. Instead, create a table that combines the currencies from both tables, then establish one-to-many relationships between this new table and the fact tables.

 

Sample Calculated table

CurrencyTable =
-- Step 1: Create a table containing only the 'Currency' column from Table1
VAR Tbl1 =
    SELECTCOLUMNS (
        Table1,
        -- Source table
        "Currency", -- Column name in the result
        Table1[Currency] -- Column to extract
    ) -- Step 2: Create a table containing only the 'Currency' column from Table2
VAR Tbl2 =
    SELECTCOLUMNS (
        Table2,
        -- Source table
        "Currency", -- Column name in the result
        Table2[Currency] -- Column to extract
    ) -- Step 3: Combine Tbl1 and Tbl2, remove duplicates, and return the result
RETURN
    DISTINCT ( UNION ( Tbl1, -- First table
            Tbl2 -- Second table
            ) )

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

2 REPLIES 2
danextian
Super User
Super User

Hi @tksnota 

 

This is why dimension tables are essential. Directly linking two fact tables isn't ideal because they often have different columns or column values. Instead, create a table that combines the currencies from both tables, then establish one-to-many relationships between this new table and the fact tables.

 

Sample Calculated table

CurrencyTable =
-- Step 1: Create a table containing only the 'Currency' column from Table1
VAR Tbl1 =
    SELECTCOLUMNS (
        Table1,
        -- Source table
        "Currency", -- Column name in the result
        Table1[Currency] -- Column to extract
    ) -- Step 2: Create a table containing only the 'Currency' column from Table2
VAR Tbl2 =
    SELECTCOLUMNS (
        Table2,
        -- Source table
        "Currency", -- Column name in the result
        Table2[Currency] -- Column to extract
    ) -- Step 3: Combine Tbl1 and Tbl2, remove duplicates, and return the result
RETURN
    DISTINCT ( UNION ( Tbl1, -- First table
            Tbl2 -- Second table
            ) )

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
bhanu_gautam
Super User
Super User

@tksnota , Can you share sample data of tables




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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