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
Manuu_108
Frequent Visitor

ESTADO DE PRODUCTO PRESTADO (DEVUELTO O ENTREGADO Y NO DEVUELTO?)

Buenas noches, me surge una cuestion con esta herramienta de Power Bi.

Es una tabla que muestra productos que se entregaron y que deben ser devueltas en todo caso si no se devolvio mediante un filtro ver con quien se encuentra el producto. (Como se muestra el resultado de Sofia)

Ejemplo:

En el caso de Ana Maria quedaria saldado ya que se le entrego el 27/01 y devolvió el 31/01. Pero en el caso de Sofia se le entregó el 31/01 y devolvió el MISMO DIA, luego mas tarde (el mismo día) se volvio a entregar el mismo producto pero no devolvio por lo cual quedaria como producto pendiente a devolver.
sofia.jpg

3 REPLIES 3
v-yangliu-msft
Community Support
Community Support

Hi  @Manuu_108 ,

 

Here are the steps you can follow:

1. Go to Power Query – select the yellow marker for [Nombre] – Sort Ascending. .

vyangliumsft_0-1675232359595.png

2. Add Column – Index Column – From 1.

vyangliumsft_1-1675232359599.png

Result:

vyangliumsft_2-1675232359600.png

3. Create calculated column.

Flag =
var _max=
MAXX(FILTER(ALL('Table'),
'Table'[Nombre]=EARLIER('Table'[Nombre])),[Index])
var _en=
COUNTX(FILTER(ALL('Table'),'Table'[Nombre]=EARLIER('Table'[Nombre])&&'Table'[Index]<=_max),[Product Entregado])
var _de=
MAXX(FILTER(ALL('Table'),
[Index]=_max),[Producto devuelto])
VAR _MAXEN=
MAXX(FILTER(ALL('Table'),
[Index]=_max),[Product Entregado])
return
IF(
    _en<>BLANK()&&_de<>BLANK(),
    [Nombre] &" "&"it would be settled"
    ,
    [Nombre] &" "&"QUDEA PENDIENTE DE DEVOLUCION DEL PRODUCTO" &" "&_MAXEN
    )

4. Result:

vyangliumsft_3-1675232359603.png

 

Best Regards,

Liu Yang

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

Esta es la tabla correcta y como deberia quedar la tabla
Envio archivo del ejemplo.
FB5.jpghttps://docs.google.com/spreadsheets/d/1MNgniQk2oy06xTWsExNNOMieS18A89_1/edit?usp=sharing&ouid=11185... FB6.jpg

amitchandak
Super User
Super User

@Manuu_108 , Create a product dimension and join with both columns, one join will inactive. Create measure for the not blank count. refer termination example in the link

 

Use userelationship to activate inactive join

 

example

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in...

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.