Forum Discussion

lucadelicio's avatar
lucadelicio
Impactful Individual
3 years ago
Solved

Count measures group by two different table without relationship

Hi everyone,

i need your help!
I have a STATUS table: Code (1, 2, 3) - Description.
I have a KRI table ID - Group - Description.
The two tables don't have any relationship.
I have n kri MEASURES that returns cod. of status (1, 2, 3).
Now i want a matrix that returns the number of KRI group by relative group (row) and status (column).
I wirte this measure that works by column but not by row. The total rows is wrong.

 
Count KRI by Status =
SUMX(
        FILTER(
            VALUES('KRI'[ID])
            ,[Switch KRI] = MAX(Status[CodeStatus])
        )
        ,1
)

Switch KRI = SWITCH(
            MAX('KRI'[ID])
            ,"KRI_01", [KRI_01 Stato]
            ,"KRI_02", [KRI_02 Stato]
            ,"KRI_03", [KRI_03 Stato]
            ,"KRI_04", [KRI_04 Stato]
            ,"KRI_15", [KRI_15 Stato]
            ,BLANK()
)


Some IDEAS?

Thank you! 🙂

 

 

 

  • I have created 4 different measure for different column for every status and the total.
    In this way avoid the problem! Thak you at all!

4 Replies