cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Frequent Visitor

## Filtro Semanas Aleatorias con Comparaciones de datos

Hola,

Tenemos un filtro de semanas en las que el usuario selecciona 3 semanas.....

Para cada semana seleccionada tenemos que mostrar el total de clientes, que se calcula mediante una medida ya que los datos por clientes los tenemos desglosados por dia.

a) Semanas elegidas

b) Clientes totales de la semana

c) Diferencia entre los clientes de la semana y la semana anterior --> este punto es el que no sabemos como construir ya que los datos dependen de la eleccion del usuario.

Muchas gracias por la ayuda ¡¡¡

Un saludo

1 ACCEPTED SOLUTION
Resolver V

Hi @EquipoPowerBI,

This is a great opportunity to use a new Power BI function called offset.

Create a measure similar with the following:

``````Diference =
VAR _last =
CALCULATE(
[# Value],
OFFSET(
-1
,
ALLSELECTED('Table'[Week])
)
)

VAR _actual = [# Value]

RETURN
IF(ISBLANK(_last), 0, _actual-_last)
``````

Result:

Check the PBI in attach with the example.

Regards,
Sérgio Silva

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

Check out my blog for tips and tricks about Power BI: https://pbibits.wordpress.com/
3 REPLIES 3
Resolver V

Hi @EquipoPowerBI,

This is a great opportunity to use a new Power BI function called offset.

Create a measure similar with the following:

``````Diference =
VAR _last =
CALCULATE(
[# Value],
OFFSET(
-1
,
ALLSELECTED('Table'[Week])
)
)

VAR _actual = [# Value]

RETURN
IF(ISBLANK(_last), 0, _actual-_last)
``````

Result:

Check the PBI in attach with the example.

Regards,
Sérgio Silva

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

Check out my blog for tips and tricks about Power BI: https://pbibits.wordpress.com/
Frequent Visitor

Thanks¡¡¡¡¡¡

It is the perfect solution ¡¡¡¡

Frequent Visitor

Gracias ¡¡¡¡¡¡

Tenemos que instalar la nueva versión para probar la solución.....estamos tramitandolo.

Muchas gracias ¡¡

Announcements

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

#### Power BI Monthly Update - May 2024

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

#### Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors