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 Buenas tardes.
Me gustaria saber como poner dos filtros de fechas para una matriz, dejo un ejemplo
Tabla
ID | Fecha | Concepto | Importe1 | Improte2 | Improte3 |
1 | 2020-01-01 00:00:00 | Concepto1 | 4929.75 | 3943.8 | 985.95 |
2 | 2019-03-01 00:00:00 | Concepto2 | 6240.7 | 4992.56 | 1248.14 |
3 | 2019-01-01 00:00:00 | Concepto3 | 8327.58 | 6662.064 | 1665.516 |
4 | 2020-01-01 00:00:00 | Concepto4 | 10915.65 | 8732.52 | 2183.13 |
5 | 2020-02-01 00:00:00 | Concepto5 | 8660.45 | 6928.36 | 1732.09 |
6 | 2019-01-01 00:00:00 | Concepto6 | 3863.39 | 3090.712 | 772.678 |
1 | 2019-09-01 00:00:00 | Concepto1 | 4029.28 | 3223.424 | 805.856 |
2 | 2019-09-01 00:00:00 | Concepto2 | 1809.14 | 1447.312 | 361.828 |
3 | 2019-05-01 00:00:00 | Concepto3 | 4994.9 | 3995.92 | 998.98 |
4 | 2019-06-01 00:00:00 | Concepto4 | 1474.28 | 1179.424 | 294.856 |
5 | 2019-10-01 00:00:00 | Concepto5 | 1492.32 | 1193.856 | 298.464 |
6 | 2019-01-01 00:00:00 | Concepto6 | 454.42 | 363.536 | 90.884 |
1 | 2019-06-01 00:00:00 | Concepto1 | 2767.6 | 2214.08 | 553.52 |
2 | 2020-01-01 00:00:00 | Concepto2 | 15773.59 | 12618.872 | 3154.718 |
3 | 2019-10-01 00:00:00 | Concepto3 | 12749.26 | 10199.408 | 2549.852 |
4 | 2020-02-01 00:00:00 | Concepto4 | 6365.05 | 5092.04 | 1273.01 |
5 | 2019-04-01 00:00:00 | Concepto5 | 5674.48 | 4539.584 | 1134.896 |
6 | 2019-04-01 00:00:00 | Concepto6 | 2767.6 | 2214.08 | 553.52 |
Enemplo de informe
Del | Al | ||||||
Rango Fecha 1 | 01/02/2020 | 29/02/2020 | |||||
Rango Fecha 2 | 01/01/2020 | 31/01/2020 | |||||
Rango Fechas 1 | Rango Fechas 2 | ||||||
ID | Concepto | Importe1 | Improte2 | Improte3 | Importe1 | Improte2 | Improte3 |
1 | Concepto1 | 12 | 13 | 12 | |||
2 | Concepto2 | 14 | 15 | 14 | |||
3 | Concepto3 | 16 | 17 | 16 | |||
4 | Concepto4 | 18 | 19 | 18 | |||
5 | Concepto5 | 20 | 20 | 20 | |||
6 | Concepto6 | 22 | 24 | 22 | |||
Total | 102 | 108 | 102 | 0 | 0 | 0 |
Espero me puedan ayudar pero espero que sea claro al pedir ayuda con esto.
Solved! Go to Solution.
Hi @davidesottura ,
Please check:
1. In Power Query Editor, unpivot columns.
In Power BI Desktop,
2. Create two Dates Tables.
Dates1 = CALENDAR ( MIN ( 'Table'[Fecha] ), MAX ( 'Table'[Fecha] ) )
Dates2 = CALENDAR ( MIN ( 'Table'[Fecha] ), MAX ( 'Table'[Fecha] ) )
3. Enter data.
Rango Fechas table:
4. Create one Measure.
Rango Values =
VAR Rango_Fechas_1_Del =
MINX ( VALUES ( Dates1[Date] ), [Date] )
VAR Rango_Fechas_1_Al =
MAXX ( VALUES ( Dates1[Date] ), [Date] )
VAR Rango1 =
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER (
'Table',
'Table'[Fecha] >= Rango_Fechas_1_Del
&& 'Table'[Fecha] <= Rango_Fechas_1_Al
)
)
VAR Rango_Fechas_2_Del =
MINX ( VALUES ( Dates2[Date] ), [Date] )
VAR Rango_Fechas_2_Al =
MAXX ( VALUES ( Dates2[Date] ), [Date] )
VAR Rango2 =
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER (
'Table',
'Table'[Fecha] >= Rango_Fechas_2_Del
&& 'Table'[Fecha] <= Rango_Fechas_2_Al
)
)
RETURN
SWITCH (
MAX ( 'Rango Fechas'[Rango Fechas] ),
"Rango Fechas 1", Rango1,
"Rango Fechas 2", Rango2
)
5. Create two Date Slicers.
6. Create a Matrix visual.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Icey buenos dias, Te agradezco mucho por la ayuda.
Soy nuevo en PWBI
Me podrias ayudar con esto mismo ya que ahora en la misma tabla tengo que agregar en cada renglon un una diferencia esta seria
Variación= importe 1 de rango 2 – importe 1 de rango 1
[importe1-Rango Fechas 2]-[importe1-Rango Fechas 1]
%Variación = ((importe 1 de rango 2 – importe 1 de rango 1)/ importe 1 de rango 1)]*100
([importe1-Rango Fechas 2]-[importe1-Rango Fechas 1])/[importe1-Rango Fechas 1])*100)
Algo asi, incluyendo los totales podrian sen mejor como una tarjeta.
Rango Fechas 1 | Rango Fechas 2 | Variación | |||||||
ID | Concepto | Importe1 | Improte2 | Improte3 | Importe1 | Improte2 | Improte3 | Variación | %Variación |
1 | Concepto1 | 12 | 13 | 12 | 30 | 18 | 150% | ||
2 | Concepto2 | 14 | 15 | 14 | 10 | -4 | -29% | ||
3 | Concepto3 | 16 | 17 | 16 | 8 | -8 | -50% | ||
4 | Concepto4 | 18 | 19 | 18 | 20 | 2 | 11% | ||
5 | Concepto5 | 20 | 20 | 20 | 15 | -5 | -25% | ||
6 | Concepto6 | 22 | 24 | 22 | 20 | -2 | -9% | ||
Total | 102 | 108 | 102 | 103 | 0 | 0 | 1 | 1% |
Por lo que he visto creo que tambien se trendria que realizar con una medida.
Espero me puedas ayudar y muchas Gracias
Hi @Icey good nigth.
Tomorrow I will Check your solution and I think that is correct, I will make my comments to you.
Icey, buenos dias, Te agradezco mucho por la ayuda.
Soy nuevo en PWBI
Me podrias ayudar con esto mismo ya que ahora en la misma tabla tengo que agregar en cada renglon un una diferencia esta seria
Variación= importe 1 de rango 2 – importe 1 de rango 1
[importe1-Rango Fechas 2]-[importe1-Rango Fechas 1]
%Variación = ((importe 1 de rango 2 – importe 1 de rango 1)/ importe 1 de rango 1)]*100
([importe1-Rango Fechas 2]-[importe1-Rango Fechas 1])/[importe1-Rango Fechas 1])*100)
Algo asi, incluyendo los totales podrian sen mejor como una tarjeta.
Rango Fechas 1 | Rango Fechas 2 | Variación | |||||||
ID | Concepto | Importe1 | Improte2 | Improte3 | Importe1 | Improte2 | Improte3 | Variación | %Variación |
1 | Concepto1 | 12 | 13 | 12 | 30 | 18 | 150% | ||
2 | Concepto2 | 14 | 15 | 14 | 10 | -4 | -29% | ||
3 | Concepto3 | 16 | 17 | 16 | 8 | -8 | -50% | ||
4 | Concepto4 | 18 | 19 | 18 | 20 | 2 | 11% | ||
5 | Concepto5 | 20 | 20 | 20 | 15 | -5 | -25% | ||
6 | Concepto6 | 22 | 24 | 22 | 20 | -2 | -9% | ||
Total | 102 | 108 | 102 | 103 | 0 | 0 | 1 | 1% |
Por lo que he visto creo que tambien se trendria que realizar con una medida.
Espero me puedas ayudar y muchas Gracias
Hi @davidesottura ,
Please check:
1. In Power Query Editor, unpivot columns.
In Power BI Desktop,
2. Create two Dates Tables.
Dates1 = CALENDAR ( MIN ( 'Table'[Fecha] ), MAX ( 'Table'[Fecha] ) )
Dates2 = CALENDAR ( MIN ( 'Table'[Fecha] ), MAX ( 'Table'[Fecha] ) )
3. Enter data.
Rango Fechas table:
4. Create one Measure.
Rango Values =
VAR Rango_Fechas_1_Del =
MINX ( VALUES ( Dates1[Date] ), [Date] )
VAR Rango_Fechas_1_Al =
MAXX ( VALUES ( Dates1[Date] ), [Date] )
VAR Rango1 =
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER (
'Table',
'Table'[Fecha] >= Rango_Fechas_1_Del
&& 'Table'[Fecha] <= Rango_Fechas_1_Al
)
)
VAR Rango_Fechas_2_Del =
MINX ( VALUES ( Dates2[Date] ), [Date] )
VAR Rango_Fechas_2_Al =
MAXX ( VALUES ( Dates2[Date] ), [Date] )
VAR Rango2 =
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER (
'Table',
'Table'[Fecha] >= Rango_Fechas_2_Del
&& 'Table'[Fecha] <= Rango_Fechas_2_Al
)
)
RETURN
SWITCH (
MAX ( 'Rango Fechas'[Rango Fechas] ),
"Rango Fechas 1", Rango1,
"Rango Fechas 2", Rango2
)
5. Create two Date Slicers.
6. Create a Matrix visual.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
106 | |
93 | |
75 | |
62 | |
50 |
User | Count |
---|---|
147 | |
107 | |
105 | |
87 | |
61 |