Forum Discussion

lascnet's avatar
lascnet
New Member
6 years ago

CREATING A CALCULATED TABLE USING DIFFERENT TABLES (MATCHING FIELDS ISSUE)

Hi, hope you all ara doing well.

Here is an issue i´m facing when creating a calculated table in Power BI.

What i'm traying to do, is using a field from the table T_TEMP (MARKED IN BLUE) in orther to gather information from other table. However, when i´m trying to match this field (MARKED IN RED) with the field of the second table (MARKED IN BLACK), it seams that the match is not working because i´m gathering an incorrect value (in this case a date).

I would appreciate your experience to know if it is the correct way to match it.

Thanks.

 

<ORIGINAL QUERY>

 

T_BITACORA =
VAR T_TEMP =
GROUPBY('Bitácora de Solicitudes de Arrendamiento',
'Bitácora de Solicitudes de Arrendamiento'[Nombre del Solicitan],
'Bitácora de Solicitudes de Arrendamiento'[Origen],
'Bitácora de Solicitudes de Arrendamiento'[Created].[Año],
'Bitácora de Solicitudes de Arrendamiento'[Created].[Mes],
'Bitácora de Solicitudes de Arrendamiento'[Created].[Día],
"Fec_Min",MINX(CURRENTGROUP(),'Bitácora de Solicitudes de Arrendamiento'[Created]),
"Fec_Max",MAXX(CURRENTGROUP(),'Bitácora de Solicitudes de Arrendamiento'[Created]))

RETURN SELECTCOLUMNS(T_TEMP,
"SOLICITUD",[Nombre del Solicitan],
"AREA",[Origen],
"AÑO",[Año],
"MES",[Mes],
"DIA",[Día],
"FECHA_MIN",[Fec_Min],
"FECHA_MAX",[Fec_Max],
"FECHA_INI",
IF([Origen] = "Comité de Crédito" && [Fec_Min] = [Fec_Max],CALCULATE(MIN('Bitácora de Solicitudes de Arrendamiento'[Created]),FILTER('Bitácora de Solicitudes de Arrendamiento','Bitácora de Solicitudes de Arrendamiento'[Nombre del Solicitan]=[Nombre del Solicitan] && 'Bitácora de Solicitudes de Arrendamiento'[Destino]="Comité de Crédito" && 'Bitácora de Solicitudes de Arrendamiento'[Acción]="Creación")),
NOW()))

3 Replies

  • edhans's avatar
    edhans
    Icon for Community Champion rankCommunity Champion

    You are going to have to post sample data and the expected result. See How to provide sample data in the Power BI Forum - Microsoft Power BI Community

     

    The only assistance I can provide without that is ensure all of your data types on the columns you are joining are exactly the same. Dates won't join with a column that contains dates but is formatted ABC/123 (any) in Power Query, or text that looks like dates for example.

  • dax's avatar
    dax
    Icon for Community Support rankCommunity Support

    Hi lascnet , 

    I am not clear about your requirement, if possible could you please inform me more detailed information(such as your expected output and your sample data (you don't need to upload real data, you could upload simple sample data))? Then I will help you more correctly.

    Please do mask sensitive data before uploading.

    Thanks for your understanding and support.
    Best Regards,
    Zoe Zhi

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