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.
Hola. Necesito ayuda para crear una columna (Qtr_Inspections) que tenga valores que pertenezcan al mes más reciente o pasado del trimestre. Básicamente, sólo quiero el último valor de cada trimestre en esta nueva columna.
Esto es lo que tengo:
Fecha | Inspecciones | Cuarto |
1/1/2020 | 0 | Qtr 1 |
2/1/2020 | 2 | Qtr 1 |
3/1/2020 | 4 | Qtr 1 |
4/1/2020 | 10 | Qtr 2 |
5/1/2020 | 3 | Qtr 2 |
6/1/2020 | 7 | Qtr 2 |
7/1/2020 | 11 | Qtr 3 |
8/1/2020 | 2 | Qtr 3 |
Esto es lo que necesito:
Fecha | Inspecciones | Cuarto | Qtr_Inspections |
1/1/2020 | 0 | Qtr 1 | 4 |
2/1/2020 | 2 | Qtr 1 | 4 |
3/1/2020 | 4 | Qtr 1 | 4 |
4/1/2020 | 10 | Qtr 2 | 7 |
5/1/2020 | 3 | Qtr 2 | 7 |
6/1/2020 | 7 | Qtr 2 | 7 |
7/1/2020 | 11 | Qtr 3 | 2 |
8/1/2020 | 2 | Qtr 3 | 2 |
Solved! Go to Solution.
Hola @mayerkath ,
Puede crear una medida o una columna calculada como se indica a continuación:
Measure =
VAR _maxdate =
CALCULATE (
MAX ( 'Inspections'[Date] ),
ALLEXCEPT ( 'Inspections', 'Inspections'[Quarter] )
)
RETURN
CALCULATE (
MAX ( 'Inspections'[Inspections] ),
FILTER (
ALLSELECTED ( 'Inspections' ),
'Inspections'[Quarter] = MAX ( 'Inspections'[Quarter] )
&& 'Inspections'[Date] = _maxdate
)
)
Columna calculada:
Qtr_Inspections =
VAR _maxdate =
CALCULATE (
MAX ( 'Inspections'[Date] ),
ALLEXCEPT ( 'Inspections', 'Inspections'[Quarter] )
)
RETURN
CALCULATE (
MAX ( 'Inspections'[Inspections] ),
FILTER (
'Inspections',
'Inspections'[Quarter] = EARLIER ( 'Inspections'[Quarter] )
&& 'Inspections'[Date] = _maxdate
)
)
Saludos
Rena
Hola @mayerkath ,
Puede crear una medida o una columna calculada como se indica a continuación:
Measure =
VAR _maxdate =
CALCULATE (
MAX ( 'Inspections'[Date] ),
ALLEXCEPT ( 'Inspections', 'Inspections'[Quarter] )
)
RETURN
CALCULATE (
MAX ( 'Inspections'[Inspections] ),
FILTER (
ALLSELECTED ( 'Inspections' ),
'Inspections'[Quarter] = MAX ( 'Inspections'[Quarter] )
&& 'Inspections'[Date] = _maxdate
)
)
Columna calculada:
Qtr_Inspections =
VAR _maxdate =
CALCULATE (
MAX ( 'Inspections'[Date] ),
ALLEXCEPT ( 'Inspections', 'Inspections'[Quarter] )
)
RETURN
CALCULATE (
MAX ( 'Inspections'[Inspections] ),
FILTER (
'Inspections',
'Inspections'[Quarter] = EARLIER ( 'Inspections'[Quarter] )
&& 'Inspections'[Date] = _maxdate
)
)
Saludos
Rena
@mayerkath , Probar como
calculate( Sum(Table[Inspections]), filter( Table,Table[Date] á max(Table[Date])), allexcept(Table, Table[Quarter]))
O
calculate( Sum(Table[Inspections]), filter( Table,format(Table[Date],"YYYYMM") á format(max( Table[Date]),"YYYYMM")), allexcept(Table, Table[Quarter]))
Gracias @amitchandak. Desafortunadamente, esto no me da lo que quiero. ¿Alguna otra idea?
@mayerkath , Por favor, encuentre el archivo adjunto después de la firma
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
2 | |
2 | |
2 | |
2 | |
1 |