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

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.

Reply
Anonymous
Not applicable

Duda medida Power Bi

Buenas. Estoy intentando hacer una medida que dado el periodo de tiempo seleccionado en el slicer me cuente el numero de programas que estaban en estado  corriendo para el ultimo registro que haya habido de cada programa en ese periodo de tiempo.

He realizado lo siguiente pero no realiza lo que quiero. La parte de decirme en que estado se encontraban en el maximo de ese periodo de tiempo lo hace bien pero la cuenta no la realiza. He puesto los campos en una tabla y veo que el actualstatus me pone un uno si el estado es running pero no hace la suma de cuantos programas estaban en running. Alguien me puede decir en que estoy fallando?

 

ActualStatus =
VAR maxDate =
CALCULATE ( MAX ( Table[DateTime] ), ALLSELECTED ( Table[DateTime] ) )
RETURN
CALCULATE(DISTINCTCOUNT(Table[ProgramName]),Table[DateTime]=maxDate,Table[Status]=="RUNNING")
2 ACCEPTED SOLUTIONS
v-stephen-msft
Community Support
Community Support

Hi @Anonymous ,

 

1.My sample data is this.

DateTime

ProgramName

Status

9/1/2020

1002

RUNNING

9/1/2020

1003

RUNNING

9/1/2020

1001

RUNNING

9/1/2020

1004

PAUSED

9/2/2020

1001

RUNNING

9/2/2020

1002

RUNNING

9/2/2020

1003

RUNNING

9/2/2020

1004

RUNNING

9/3/2020

1003

RUNNING

9/3/2020

1001

PAUSED

9/3/2020

1002

RUNNING

9/3/2020

1004

RUNNING

9/4/2020

1001

PAUSED

9/4/2020

1002

RUNNING

9/4/2020

1003

RUNNING

9/4/2020

1004

PAUSED

9/5/2020

1001

PAUSED

9/5/2020

1002

RUNNING

9/5/2020

1003

PAUSED

9/5/2020

1004

RUNNING

9/6/2020

1004

RUNNING

 

2.Try this measure.

Count = 
CALCULATE (
    COUNTROWS ( 'Table' ),
    FILTER (
        ALLEXCEPT ( 'Table', 'Table'[ProgramName] ),
        [Status] = "RUNNING"
            && [DateTime] = MAX ( 'Table'[DateTime] )
    )
)

 

3.Choose between the types of slicers.

8.png

 

4.The result is this.

result slicer.gif

 

You can check more details from here.

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

Lo he provado en mis datos y me sigue dando la cuenta 1 o en blanco.

View solution in original post

3 REPLIES 3
v-stephen-msft
Community Support
Community Support

Hi @Anonymous ,

 

1.My sample data is this.

DateTime

ProgramName

Status

9/1/2020

1002

RUNNING

9/1/2020

1003

RUNNING

9/1/2020

1001

RUNNING

9/1/2020

1004

PAUSED

9/2/2020

1001

RUNNING

9/2/2020

1002

RUNNING

9/2/2020

1003

RUNNING

9/2/2020

1004

RUNNING

9/3/2020

1003

RUNNING

9/3/2020

1001

PAUSED

9/3/2020

1002

RUNNING

9/3/2020

1004

RUNNING

9/4/2020

1001

PAUSED

9/4/2020

1002

RUNNING

9/4/2020

1003

RUNNING

9/4/2020

1004

PAUSED

9/5/2020

1001

PAUSED

9/5/2020

1002

RUNNING

9/5/2020

1003

PAUSED

9/5/2020

1004

RUNNING

9/6/2020

1004

RUNNING

 

2.Try this measure.

Count = 
CALCULATE (
    COUNTROWS ( 'Table' ),
    FILTER (
        ALLEXCEPT ( 'Table', 'Table'[ProgramName] ),
        [Status] = "RUNNING"
            && [DateTime] = MAX ( 'Table'[DateTime] )
    )
)

 

3.Choose between the types of slicers.

8.png

 

4.The result is this.

result slicer.gif

 

You can check more details from here.

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Buenas veo que tu medida realiza la cuenta pero no es tal cual la necesito. Necesito que dado el periodo de tiempo seleccionado cuente los equipos que se encuentran en running en su ultimo estado. Por ejemplo para los datos tuyos el dia 9/6/2020 la cuenta deberia ser 2. Ya que el programa 1004 ese mismo dia estaba en running y el 1002 el dia anterior estaba en running y al no haber mas registros de ese programa entendemos que para el dia 9/6/2020 sigue en running.

Anonymous
Not applicable

Lo he provado en mis datos y me sigue dando la cuenta 1 o en blanco.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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