Forum Discussion

rcardenasbc's avatar
rcardenasbc
Frequent Visitor
2 years ago
Solved

Problem with dax measure and relation ship

Hello, I have a problem with some tables and I don't know how to solve it, the tables are

• A main GLS table containing all accounts and the department they belong to
• The DaxCalendar table by month
• The department table containing the department
• Two tables with the values ​​of the real amount, one (TReal) and the theoretical amount in the other (TPlan),
• And a table containing the department, account, month and comment (GLxDepartxMonth)

The relationship is direct between GLS, DaxCalendar, TReal, TPlan and department
GLxDepartxMonth has a relationship with GLS, DaxCalendar but it is not the main relationship with department

The problem is that, when I show the account, the real and theoretical amount per month and selected department and I put the justification, it is duplicated for each department.
This dax does not work for me, what can I do to request it?

Just1 =
CALCULATE(
    FIRSTNONBLANK(GLxDepartxMonth[Justificacion],BLANK()),
    GLxDepartxMonth[Departamento.Temp] = SELECTEDVALUE(Department[Departamento]) &&
    GLxDepartxMonth[MesTxt] = SELECTEDVALUE('DAX Calendar'[MesTexto]) &&
    GLxDepartxMonth[GL] = SELECTEDVALUE(AllGL[GL])
 
Thanks for the help
 

 

  • I resolve the problem unsaing 

    Just1 =
    VAR DepartSelect = SELECTEDVALUE(Department[Departamento])
    VAR MonthSelect= SELECTEDVALUE('DAX Calendar'[MesTexto])
    VAR GLSelect = SELECTEDVALUE(AllGL[GL])
    VAR Result = LOOKUPVALUE(
        GLxDepartxMonth[Justificacion],
        GLxDepartxMonth[Departamento.Temp], DepartSelect,
        GLxDepartxMonth[MesTxt], MonthSelect,
        GLxDepartxMonth[GL], GLSelect
    )
    RETURN  Result

1 Reply

  • rcardenasbc's avatar
    rcardenasbc
    Frequent Visitor

    I resolve the problem unsaing 

    Just1 =
    VAR DepartSelect = SELECTEDVALUE(Department[Departamento])
    VAR MonthSelect= SELECTEDVALUE('DAX Calendar'[MesTexto])
    VAR GLSelect = SELECTEDVALUE(AllGL[GL])
    VAR Result = LOOKUPVALUE(
        GLxDepartxMonth[Justificacion],
        GLxDepartxMonth[Departamento.Temp], DepartSelect,
        GLxDepartxMonth[MesTxt], MonthSelect,
        GLxDepartxMonth[GL], GLSelect
    )
    RETURN  Result