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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
EquipoPowerBI
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.

El cuadro seria algo asi: 

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.

 

Captura de pantalla.jpg

 

Muchas gracias por la ayuda ¡¡¡

Un saludo

 

1 ACCEPTED SOLUTION
SergioSilvaPT
Resolver V
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:

SergioSilvaPT_0-1672746916244.png

 

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/

View solution in original post

3 REPLIES 3
SergioSilvaPT
Resolver V
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:

SergioSilvaPT_0-1672746916244.png

 

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/

Thanks¡¡¡¡¡¡

It is the perfect solution ¡¡¡¡

Gracias ¡¡¡¡¡¡

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

Muchas gracias ¡¡

 

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors