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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
daqueved
New Member

Filtrar Dato Maximo por Fila

Buenas tardes.

 

Tengo la siguiente tabla de datos con un pedido y sus diferentes estados, con fecha y hora del cambio ejecutado y el usuario que lo ejecuto.

daqueved_0-1637614984221.png

 

Lo que se necesita es crear otra tabla pero mostrando el ultimo registro en fecha y hora ejecutado. Es decir mostrar el usuario que hizo la ultima modificaciòn. Quedaria algo asì: Mostrando solo los valores en amarillo.

 

daqueved_1-1637615296045.png

 

 

Gracias espero me ayuden. Muy amables.

 

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @daqueved 

Thanks for reaching out to us.

 

Here are 2 ways to create the new table you want, their results are same. You can select anyone you like.

 

(1) click the New Table, then put the Dax expression into it,

vxiaotang_0-1637823772871.png

newTable = 
    var _searchStatus1="DPOLANIA"
    var _searchStatus2="OORDONEG"
return
    FILTER(('Table'),'Table'[Fecha/ Hora de Inicio Tratamiento Alarma]=CALCULATE(MAX('Table'[Fecha/ Hora de Inicio Tratamiento Alarma]),FILTER(ALLEXCEPT('Table','Table'[Sucursal],'Table'[Manifiesto],'Table'[Remesa]),'Table'[Usuario Repona Alarms]=_searchStatus1||'Table'[Usuario Repona Alarms]=_searchStatus2)))

vxiaotang_1-1637823795596.png

 

(2) add a new column in your initial table, 

vxiaotang_2-1637823867216.png

Column = 
    var _searchStatus1="DPOLANIA"
    var _searchStatus2="OORDONEG"
    var _max= CALCULATE(MAX('Table'[Fecha/ Hora de Inicio Tratamiento Alarma]),FILTER(ALLEXCEPT('Table','Table'[Sucursal],'Table'[Manifiesto],'Table'[Remesa]),'Table'[Usuario Repona Alarms]=_searchStatus1||'Table'[Usuario Repona Alarms]=_searchStatus2))
return 
    IF('Table'[Fecha/ Hora de Inicio Tratamiento Alarma]=_max,1,0)

then click the New Table, put the Dax expression into it,

Table 2 = FILTER('Table','Table'[Column]=1)

vxiaotang_3-1637823988919.png

 

Besides, if you don't want to create a new table, you can also filter the visual to get same visual effect. Here is the method,

create the measure, then put it into visual level filter and set the value to 1.

FilterMeasure = 
    var _searchStatus1="DPOLANIA"
    var _searchStatus2="OORDONEG"
    var _max= CALCULATE(MAX('Table'[Fecha/ Hora de Inicio Tratamiento Alarma]),FILTER(ALLEXCEPT('Table','Table'[Sucursal],'Table'[Manifiesto],'Table'[Remesa]),'Table'[Usuario Repona Alarms]=_searchStatus1||'Table'[Usuario Repona Alarms]=_searchStatus2))
return 
    IF(MAX('Table'[Fecha/ Hora de Inicio Tratamiento Alarma])=_max,1,0)

vxiaotang_4-1637824325421.png

 

 

Best Regards,

Community Support Team _Tang

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

View solution in original post

1 REPLY 1
v-xiaotang
Community Support
Community Support

Hi @daqueved 

Thanks for reaching out to us.

 

Here are 2 ways to create the new table you want, their results are same. You can select anyone you like.

 

(1) click the New Table, then put the Dax expression into it,

vxiaotang_0-1637823772871.png

newTable = 
    var _searchStatus1="DPOLANIA"
    var _searchStatus2="OORDONEG"
return
    FILTER(('Table'),'Table'[Fecha/ Hora de Inicio Tratamiento Alarma]=CALCULATE(MAX('Table'[Fecha/ Hora de Inicio Tratamiento Alarma]),FILTER(ALLEXCEPT('Table','Table'[Sucursal],'Table'[Manifiesto],'Table'[Remesa]),'Table'[Usuario Repona Alarms]=_searchStatus1||'Table'[Usuario Repona Alarms]=_searchStatus2)))

vxiaotang_1-1637823795596.png

 

(2) add a new column in your initial table, 

vxiaotang_2-1637823867216.png

Column = 
    var _searchStatus1="DPOLANIA"
    var _searchStatus2="OORDONEG"
    var _max= CALCULATE(MAX('Table'[Fecha/ Hora de Inicio Tratamiento Alarma]),FILTER(ALLEXCEPT('Table','Table'[Sucursal],'Table'[Manifiesto],'Table'[Remesa]),'Table'[Usuario Repona Alarms]=_searchStatus1||'Table'[Usuario Repona Alarms]=_searchStatus2))
return 
    IF('Table'[Fecha/ Hora de Inicio Tratamiento Alarma]=_max,1,0)

then click the New Table, put the Dax expression into it,

Table 2 = FILTER('Table','Table'[Column]=1)

vxiaotang_3-1637823988919.png

 

Besides, if you don't want to create a new table, you can also filter the visual to get same visual effect. Here is the method,

create the measure, then put it into visual level filter and set the value to 1.

FilterMeasure = 
    var _searchStatus1="DPOLANIA"
    var _searchStatus2="OORDONEG"
    var _max= CALCULATE(MAX('Table'[Fecha/ Hora de Inicio Tratamiento Alarma]),FILTER(ALLEXCEPT('Table','Table'[Sucursal],'Table'[Manifiesto],'Table'[Remesa]),'Table'[Usuario Repona Alarms]=_searchStatus1||'Table'[Usuario Repona Alarms]=_searchStatus2))
return 
    IF(MAX('Table'[Fecha/ Hora de Inicio Tratamiento Alarma])=_max,1,0)

vxiaotang_4-1637824325421.png

 

 

Best Regards,

Community Support Team _Tang

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.