Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
rcardenasbc
Frequent Visitor

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
 
rcardenasbc_0-1718467343365.pngrcardenasbc_1-1718467373730.png

 

1 ACCEPTED SOLUTION
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

View solution in original post

1 REPLY 1
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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.