The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hola
Estoy buscando un formule DAX para clasificar la fecha kolomn. No hay filtros adicionales en el cliente ect, sólo clasificar la fecha.
Cada mes se cargan nuevos datos en el modelo PowerBI. Ahora quiero añadir un Kolomn para que 1 meses más nuevos, 2 meses antes, etc. ¿Puede alguien ayudarme en esto?
Mesa:
Mes | Cliente | Cantidad |
jan-20 | 1 | 100 |
feb-20 | 1 | 122 |
feb-20 | 1 | 1 |
mar-20 | 1 | 140 |
Resultado:
Mes | Cliente | Cantidad | rango |
jan-20 | 1 | 100 | 3 |
feb-20 | 1 | 122 | 2 |
feb-20 | 1 | 1 | 2 |
mar-20 | 1 | 140 | 1 |
Solved! Go to Solution.
Hola @tomwolswijk ,
Puede probar esta columna calculada.
Rank =
RANKX (
'Table',
RANKX ( 'Table', YEAR ( 'Table'[Date] ),, DESC, DENSE ) * 100
+ RANKX ( 'Table', MONTH ( 'Table'[Date] ),, DESC, DENSE ),
,
ASC,
DENSE
)
Puede consultar más detalles desde aquí.
Saludos
Stephen Tao
Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
Gracias
Hola @tomwolswijk ,
Puede probar esta columna calculada.
Rank =
RANKX (
'Table',
RANKX ( 'Table', YEAR ( 'Table'[Date] ),, DESC, DENSE ) * 100
+ RANKX ( 'Table', MONTH ( 'Table'[Date] ),, DESC, DENSE ),
,
ASC,
DENSE
)
Puede consultar más detalles desde aquí.
Saludos
Stephen Tao
Si este post ayuda,entonces considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.
¡Muchas gracias! ¡Funcionó!
Usé 'Table'[Month] en lugar de 'Table'[Date], porque month ya es un tipo de datos de fecha. ¡Gracias!
puede usar todos excepto o subcategoría para el mes
Para rango Consulte estos enlaces
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/3...
Lo intenté;
@tomwolswijk, creé una medida y luego usé Rank
Measure = CALCULATE(SUM('Table (2)'[Amount]) ,ALLEXCEPT('Table (2)','Table (2)'[Month]))
Measure 2 = rankx(ALL('Table (2)'[Month]),[Measure])
La medida que dio es clasificar [Cantidad]. Pero sólo quiero dar a mi valor de fecha un rango basado en la fecha, sin usar otras variables.
Para hacerlo simple:
Mes | rango |
01-12-2019 | 5 |
01-01-2020 | 4 |
01-02-2020 | 3 |
01-04-2020 | 2 |
01-06-2020 | 1 |
Gracias por tu ayuda
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.