Forum Discussion

ChirSidh's avatar
ChirSidh
Helper II
3 years ago

Add dual value to Power BI Matrix Visual

How to add two different values in a Power BI matrix visual, one at the project level and the other at the subproject level.

I have Project and Sub Project (Work order) in rows and month number in columns. What i want to do is add Project Level multiplier to Project row and Sub Project level multiplier to Sub Project row, but if i add two values in the values section, Matrix visual is creating different column fot the second value section, is there anyway by using DAX i can add different values to different level rows

13 Replies

  • ChirSidh , calculate two different measure and switch using isinscope,

     

    Switch(True(),

    isinscope(Table[Work Order no]), [M1],

    isinscope(Table[Project]), [M2],

    [M3]

    )

     

    How to Switch Subtotal and Grand Total in Power BI | Power BI Tutorials: https://youtu.be/smhIPw3OkKA

  • Hi Amit, i already have a custom column created for Project Level Multiplier by grouping the Work order level multiplier to Project level in Power query.

    and work order level multplier is already available in my spreadsheer.

     do i still have to create two new measures , i am sorry if this is a silly question, i am just new to Power BI so having a hard time to understand the video you have shared

  • Hi ChirSidh ,

    My solution is similar with amitchandak 's, I create a sample to clarify it.

    Sample:

    If you want to show Column1 in Project and show Column2 in Sub_project, create a measure as below:

    Measure =
    IF (
        ISINSCOPE ( 'Table'[Sub_project] ),
        MAX ( 'Table'[Column2] ),
        MAX ( 'Table'[Column1] )
    )
    

    Put the measure in matrix Values, get the correct result:

    I attach my sample below for your reference.

     

    Best regards,

    Community Support Team_yanjiang

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

    • ChirSidh's avatar
      ChirSidh
      Helper II

      Thank you , but there is a problem with this when i add multiple months in the columns as showin in my first message , for all the months it is showing the same number, i think it is just taking the max of sub project values.  please see my screenshot 

      • v-yanjiang-msft's avatar
        v-yanjiang-msft
        Community Support

        Hi ChirSidh ,

        Are the [Work Order No] column and month column in the same table or are they related? If so, the MAX function will extract the current value for the pair, otherwise it will extract the max value.

         

        Best regards,

        Community Support Team_yanjiang

  • Hello everyone, anyone has solution for the problem i mentioned?