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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Create A Graph Between Time And Distinct Value

Hello so i have a table containing date time and Status Status is :DNC(Do not call) , Sale(Sale made)... So i want to create a graph where i only need the count of DNC on a graph over time not the date but time as in 7:09, 13:39,20:08....

1 ACCEPTED SOLUTION
v-cazheng-msft
Community Support
Community Support

Hi @Anonymous ,

 

You may try this solution.

Here are the sample data.

vcazhengmsft_0-1658801315699.png

 

1 Create a Calculated column

Time = FORMAT('Table'[DateTime],"hh:mm")

 

2 Create a measure to count DNC

Count DNC = CALCULATE(COUNT('Table'[ Status]),FILTER('Table','Table'[ Status]="DNC(Do not call)"))

 

The result looks like this.

vcazhengmsft_1-1658801315701.png

 

Also, attached the pbix file as reference.

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know. Thanks a lot!

 

Best Regards,

Community Support Team _ Caiyun

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hello so i have a table containing date time and Status Status is :DNC(Do not call) , Sale(Sale made)... So i want to create a graph where i only need the count of DNC on a graph over time not the date but time as in 7:09, 13:39,20:08....

@Anonymous You can get just the time value in a column like this:

Time = TIME(HOUR([DateTime]), MINUTE([DateTime], SECOND([DateTime]))



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler what about the distinct status? i want the count of how many DNC only 

@Anonymous You can use DISTINCTCOUNT or COUNTROWS(DISTINCT('Table[Column]))



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
v-cazheng-msft
Community Support
Community Support

Hi @Anonymous ,

 

You may try this solution.

Here are the sample data.

vcazhengmsft_0-1658801315699.png

 

1 Create a Calculated column

Time = FORMAT('Table'[DateTime],"hh:mm")

 

2 Create a measure to count DNC

Count DNC = CALCULATE(COUNT('Table'[ Status]),FILTER('Table','Table'[ Status]="DNC(Do not call)"))

 

The result looks like this.

vcazhengmsft_1-1658801315701.png

 

Also, attached the pbix file as reference.

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know. Thanks a lot!

 

Best Regards,

Community Support Team _ Caiyun

amitchandak
Super User
Super User

@Anonymous , Create two separate column in table

 

Date = Datevalue([Datetime])

 

Time = timevalue([datetime])

 

And create a measure and use it with time

 

measure = countrows(filter(Table,Table[DND] = "Y"))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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