Forum Discussion

jimod's avatar
jimod
Regular Visitor
2 years ago
Solved

Difficulty with measures

 
I have a dax measue that evaluates conditions in the rows of table based on a combination of values from another table:
Autorisatie_fact = IF (
        COUNTROWS (
            FILTER (
                FACT_Realisatie,
                FACT_Realisatie[Kostenplaats_Key] = LOOKUPVALUE(RLS_Rol[Kostenplaats_Key], RLS_Rol[Kostenplaats_Key], FACT_Realisatie[Kostenplaats_Key]) ||
                FACT_Realisatie[Product_Key] = LOOKUPVALUE(RLS_Rol[Product_Key], RLS_Rol[Product_Key], FACT_Realisatie[Product_Key])
            )
        ) > 1,
        1,
        0
    )
 
There are purposefully no relations between the tables. I have another measure that returns another column text value if the conditions are met:
Crediteur =
IF(
        [Autorisatie_fact] = 1,
        SELECTEDVALUE(FACT_Realisatie[Crediteur]),
        "***"
   
)
This works fine but, now i want also to be able to summarize the text values output in order to aggregate the rows with other measures sum average etc...it needs to be done in measures in order to make the filter context apply.
 I have spend a week talking to chat gpt but still no working result. 
 
It should be something like: 
crediteurconditionbedrag
A110
B120
A110
C010

 

CrediteurBedrag 
A20 
B20 
 
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi jimod ,

     

    (1)Here are my test data.

    (2) We can create a new table.

    Table 2 = FILTER(SUMMARIZE('Table',[Rediteur],"bedrag",SUM('Table'[bedrag])),[Rediteur] in {"A","B"})

    (3) Then the result is as follows.

     

    If this doesn't help you, give examples of input and output data and explain your logic. Preferably a PBIX file (take care to protect your private data)

     

    Best Regards,

    Neeko Tang

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

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi jimod ,

     

    (1)Here are my test data.

    (2) We can create a new table.

    Table 2 = FILTER(SUMMARIZE('Table',[Rediteur],"bedrag",SUM('Table'[bedrag])),[Rediteur] in {"A","B"})

    (3) Then the result is as follows.

     

    If this doesn't help you, give examples of input and output data and explain your logic. Preferably a PBIX file (take care to protect your private data)

     

    Best Regards,

    Neeko Tang

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