Forum Discussion

Analysis1103's avatar
Analysis1103
Regular Visitor
2 years ago

Changing the value in a matrix based on row label

Hello everyone! I had a measure that was able to change the value in a matrix based on the row label but for some reason it does not appear to work anymore. The measure is as follow:

 

Measure =
IF(
    SELECTEDVALUE(Table[Column]) = "Row Name",
    0,
    [Measure Calculation]
)
 
The measure now does the calculation and doesn't do the zero logic. The matrix has more than one column (based on a single column from a table) if that matters. The result I would like is for when the row is "Row Name", the matrix shows 0 for all cells in that row.

3 Replies

  • Analysis1103 ,  Try

     

    Measure =
    IF(
    SELECTEDVALUE(Table[Column]) = "Row Name",
    0,
    [Measure Calculation]
    ) +0

     

     

    or

    Measure =
    IF(
    SELECTEDVALUE(Table[Column]) = "Row Name",
    calculate( 0, Table[Column]) = "Row Name),
    [Measure Calculation]
    )

    • Analysis1103's avatar
      Analysis1103
      Regular Visitor

      Thank you for the suggestion but unfortunately these did not work. The selected value logic doesn't seem to flag the row, thus the measure calculation at the end of the if statement is executed.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Analysis1103 

     

    Try the folloing measure

    Measure =
    IF(
        HASONEVALUE(Table[Column]) && SELECTEDVALUE(Table[Column]) = "Row Name",
        0,
        [Measure Calculation]
    )
    

     

    If the measure above doesn‘t help slove your problem, please provide detailed sample pbix file and the results you expect.So that I can help you better. Please remove any sensitive data in advance.

     

     

     

    Best Regards,

    Jayleny

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.