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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
vasu6811
Frequent Visitor

not able to display graph using measure

Hi All,

 

I am facing an issue in Power BI Desktop. I have created a measure for calculating last status based on timestamp for each employee. Now I want to draw a bar chart to display count of emplyee for each status.

 

Here is sample data

 

EmployeeIdStatusIDDatestamp
112017-05-01 11:30:00
132017-05-01 11:35:00
122017-05-01 11:40:00
232017-05-01 11:30:00
222017-05-01 11:35:00
212017-05-01 11:40:00
332017-05-01 11:42:00
412017-05-01 11:42:00

 

Status Table

StatusIDStatus Name
1Started
2In progress
3Completed

 

I am expecting result in graph as following (count of employee is based on latest status 

 

Status NameCount of Employees
Started2
In progress1
Completed1

 

Thanks in Advance.

2 REPLIES 2
v-jiascu-msft
Microsoft Employee
Microsoft Employee

@vasu6811

 

Hi,

 

Could you please tell me if your problem is solved? You can mark the right answer to help others if it's convenient for you.

 

Best Regards!
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-jiascu-msft
Microsoft Employee
Microsoft Employee

@vasu6811

 

Hi,

 

At the first glance, it's very easy. But there are many tricks. A calculated column is recommended. Here is the formula. Please have a try.

IsLatest =
CALCULATE (
    IF ( COUNT ( 'Sample'[Datestamp] ) = 1, 1, 0 ),
    FILTER (
        'Sample',
        'Sample'[Datestamp] >= EARLIER ( 'Sample'[Datestamp] )
            && 'Sample'[EmployeeId] = EARLIER ( 'Sample'[EmployeeId] )
    )
)

 

not able to display graph using measure .jpg 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards.

Dale

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

Helpful resources

Announcements
Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

Top Solution Authors