Forum Discussion

Luisevivar's avatar
Luisevivar
Regular Visitor
6 years ago

DAX Date Formula // Formula DAX para Fechas

Buenas comunidad, 

 

Actualmente tengo el siguiente problema:

Tengo que crear una tabla para un report de Power BI que indique la cantidad de recetas medicas que estuvieron activas cada mes. 

 

Cada receta medica tiene: 

  1. Un id unico
  2. Una fecha de inicio
  3. Una fecha de fin

Se les considera recetas medicas activas en el periodo que va desde su fecha de inicio hasta su fecha de fin. 

 

¿Como puedo hacer para que la formula me incluya todas las recetas activas por mes? Ejemplo:

Num receta medicaFecha inicioFecha fin  
101/01/201831/01/2018  
202/08/201831/12/2022  
301/01/201915/08/2019  
431/07/201905/09/2019  
Cantidad de recetas activasActivas
ene-181Receta 1  
ene-192Receta 2Receta 3 
ago-193Receta 2Receta 3Receta 4

 

Debo generar una tabla como esta: 

Cantidad de recetas activas
ene-181
ene-192
ago-193

 

------------------------------------------

Good community,

 

I currently have the following problem:

I have to create a table for a Power BI report that indicates the number of prescriptions that were active each month.

 

Each prescription has:

A unique id
A start date
An end date
They are considered active medical prescriptions in the period from their start date to their end date.

 

How can I make the formula include all active recipes per month? Example:

Prescription IDStart DateEnd date  
101/01/201831/01/2018  
202/08/201831/12/2022  
301/01/201915/08/2019  
431/07/201905/09/2019  
# of Active prescriptionsActives
jan-181Prescription 1  
jan-192Prescription 2Prescription 3 
ago-193Prescription 2Prescription 3Prescription 4
No RepliesBe the first to reply