Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Link Measures to a Column

Hello everyone, I have 17 measures that are all stored in a Calendar Table. These measures are derived from multiple calculations coming from multiple tables as well. I'm trying to link...
  • danextian's avatar
    1 year ago

    Hi Anonymous 

     

    You will need to create a measure that switches according to the row  value from a disconnected table column

    For example,

    SWITCH (
        SELECTEDVALUE ( 'metrics'[metrics name] ),
        "Sales", [Sales Measure],
        "Volume", [Volume Measure],
        "ATV", DIVIDE ( [Sales Measure], [Volume Measure] )
    )
    

     

    Even if there isn't a relationship between metrics and other tables, the measures should still return the correct value as they're calculation is essentially being affected by the other tables.

  • v-sgandrathi's avatar
    1 year ago

    Hi Anonymous,
    Thank you for reaching out to the Microsoft Fabric Community forum.

     

    As you mentioned, 17 measures are derived from multiple calculations and tried to create a calculated column that switches between each column which doesn’t work.

     

    Yes, it doesn’t work because the issue here is that calculated columns cannot hold or switch between measures as measures are evaluated dynamically when you interact with a visual. By using calculated columns, it cannot hold multiple measure values. This is why the approach of creating a calculated column to link measures to the 'Physical Flow' column is not working.

     

    Instead of using a calculated column, we can create a separate Mapping Table which link each measure to its respective category. This table will act as a bridge to organize the measures properly. After that we can build dynamic measures in Power BI that will show the correct values for each category without duplications. This method ensures accurate results in your reports.

     

    If this post helps, please give us Kudos and consider Accept it as a solution to help the other members find it more easily.

     

    Best Regards,
    Sahasra.