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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
PedroPablo
Helper I
Helper I

create measure with range to compare after performing a segmentation

Hi

 

I need create measure with range 2 to compare targeting selection or some other solution that allows me to compare the current evaluation with the previous one, given a previous segment of year.

 

Tables

 

TB_EVALUATION_HISTORY

   

ID_checkGroup

ID_pHistory

ID_parent

ID_current_Assessment

Period

RANK

EVALUATIONS

check_11170202213_LOW
check_32135201922_MEDIUM
check_13263202211_HIGH
check_24237202123_LOW
check_1.95220202032_MEDIUM
check_1.96340202032_MEDIUM
check_1.97543202011_HIGH
check_28345202121_HIGH
check_39341201933_LOW
check_11034920221

1_HIGH

 

Column detail
ID_checkGroupplanification identification
ID_pHistorysecuencial
ID_parentid to review context
ID_current_AssessmentEValuation
PeriodPlan period
RANKcolumn calculation to identify sequencial evaluation, considering all records

 

TB_EVALUATIONS
ID_current_AssessmentEVALUATIONS
703_LOW
352_MEDIUM
631_HIGH
373_LOW
202_MEDIUM
402_MEDIUM
431_HIGH
452_MEDIUM
413_LOW
491_HIGH

 

when i click on the period (2022).

The graph shows me all the records that were evaluated in 2022. But I can't show the previous evaluation done on the same record.

 

Expected graph, click on 2022

 

PedroPablo_6-1669057628356.png

 

 

Expected graph, when i click on the period (2021).

 

PedroPablo_7-1669057686474.png

 

 

THANKS!!

 

 

 

 

1 ACCEPTED SOLUTION

@PedroPablo ,

Dado que las dos publicaciones son el mismo problema, te ayudé a fusionar en una sola publicación.

Espero que no te importe.

Aquí está el alma para devolver la evaluación anterior (rango + 1).

Puede crear la siguiente medida. Aún así, colóquelo en el filtro de nivel visual y configure mostrar elementos cuando el valor sea 1.

Measure =
VAR _rank =
    CALCULATE (
        SUM ( 'TB_EVALUATION_HISTORY'[Rank] ),
        FILTER (
            ALLSELECTED ( 'TB_EVALUATION_HISTORY' ),
            [ID_parent] = MAX ( 'TB_EVALUATION_HISTORY'[ID_parent] )
                && [Period] = SELECTEDVALUE ( 'TBPeriod'[Period] )
        )
    )
RETURN
    IF (
        IF ( ISBLANK ( _rank ), BLANK (), _rank + 1 )
            = MAX ( 'TB_EVALUATION_HISTORY'[Rank] ),
        1
    )
v

19.png

Saludos

Esteban Tao

Si esta publicación ayuda, considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

View solution in original post

6 REPLIES 6
PedroPablo
Helper I
Helper I

hi tao!!

Sorry for the response time.

In general terms I need to always get the lowest rank  and the next one. Always starting from the selected year and in case of not being selected any year obtain all the ranks 1 and 2 of the table.

 

 

It's not really the year+1. It is the previous evaluation, that is rank+1.

The next record was misentered. I was with Tank 3, but it's rank 4. The rank is the column that classifies the sequence of evaluations 🙂 I've changed it

PedroPablo_1-1669382125341.png

PedroPablo_0-1669382005803.png

 

 

Syndicate_Admin
Administrator
Administrator

@PedroPablo ,

Desea filtrar un año en función de la segmentación de datos y, a continuación, devolver los valores del año filtrado y el año anterior del año filtrado, ¿verdad?

Es posible que necesite una segmentación de datos de año por separado. Puede crear una tabla de años con DAX.

Table = DISTINCT('TB_EVALUATION_HISTORY'[Period])

vstephenmsft_0-1669083711755.png

A continuación, cree una medida como filtro de nivel visual.

Measure =
VAR _year =
    MAX ( 'TB_EVALUATION_HISTORY'[Period] )
VAR _select =
    CALCULATE (
        MAX ( 'TB_EVALUATION_HISTORY'[Period] ),
        FILTER (
            ALLSELECTED ( TB_EVALUATION_HISTORY ),
            [ID_parent] = MAX ( 'TB_EVALUATION_HISTORY'[ID_parent] )
                && [Period] = SELECTEDVALUE ( 'Table'[Period] )
        )
    )
RETURN
    IF ( _select = _year || _select - 1 = _year, 1 )

Coloque la medida en el filtro de nivel visual del objeto visual de la tabla. Configure mostrar elementos cuando el valor sea 1.

11.png

Saludos

Esteban Tao

Si esta publicación ayuda, considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

Lo siento por el tiempo de respuesta.

No es realmente el año + 1. Es la evaluación previa, es decir, rango+1..

@PedroPablo ,

Dado que las dos publicaciones son el mismo problema, te ayudé a fusionar en una sola publicación.

Espero que no te importe.

Aquí está el alma para devolver la evaluación anterior (rango + 1).

Puede crear la siguiente medida. Aún así, colóquelo en el filtro de nivel visual y configure mostrar elementos cuando el valor sea 1.

Measure =
VAR _rank =
    CALCULATE (
        SUM ( 'TB_EVALUATION_HISTORY'[Rank] ),
        FILTER (
            ALLSELECTED ( 'TB_EVALUATION_HISTORY' ),
            [ID_parent] = MAX ( 'TB_EVALUATION_HISTORY'[ID_parent] )
                && [Period] = SELECTEDVALUE ( 'TBPeriod'[Period] )
        )
    )
RETURN
    IF (
        IF ( ISBLANK ( _rank ), BLANK (), _rank + 1 )
            = MAX ( 'TB_EVALUATION_HISTORY'[Rank] ),
        1
    )
v

19.png

Saludos

Esteban Tao

Si esta publicación ayuda, considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

@v-stephen-msft

Esto efectivamente resuelve el boleto, gracias!!

si es posible, necesito contar registro con condición

@PedroPablo ,

Este es un requisito completamente nuevo, para esto, se recomienda que vuelva a abrir una nueva publicación, gracias. 😁

Me alegra saber que mi solución funciona.

Saludos

Esteban Tao

Si esta publicación ayuda, considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors