Forum Discussion

OnlyPhilip's avatar
OnlyPhilip
Frequent Visitor
6 years ago
Solved

Text value from a column to filter another table

Hi everybody, I can't figure out how to retrieve the text value (the metal field in the example below) from a column to be used as a filter for another column, row by row, so to fill a visual table....
  • mahoneypat's avatar
    6 years ago

    You can not need the inactive relationship at all if your use an approach using TREATAS() as follows:

     

    Total Value =
    VAR __qty =
    SUM ( Production[Produced Quantity] )
    VAR __metalvalue =
    CALCULATE (
    MIN ( MetalValues[Value] ),
    TREATAS ( VALUES ( Production[Date] ), MetalValues[Date] ),
    TREATAS ( VALUES ( Production[Metal] ), MetalValues[Metal] )
    )
    RETURN
    __qty * __metalvalue

     

    Or you could use USERELATIONSHIP for the date and just use TREATAS() on metal column.  Note: this assumes you are using the columns from Production in your visuals (for Metal and Date).

     

    If this works for you, please mark it as solution.  Kudos are appreciated too.  Please let me know if not.

    Regards,

    Pat