cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
creynolds
Helper V
Helper V

Card Visual

I want to use the Card visual to show the total hours worked for support calls for when a category is selected e.g., Software, Hardware, etc..   Each request has an ID assigned, however, there may be multiple entries for the same request.    Example, Request ID#353 has 12 hours recorded on 10/1/2021 and another entry on 10/15/2021 for 2 hours.    Total hours worked for Request ID#353 is 14 Hours.  How can I use the Card visual to show total hours?   Or is there another visual I should use? 

9 REPLIES 9
v-xiaotang
Community Support
Community Support

Hi @creynolds 

Thanks for reaching out to us.

Is there any relationship between the 2 tables?

 

If it has one to many relationship, then you can set the summarization of field [hours] to Sum, then put the field [hours] into Card visual.

vxiaotang_0-1634609976574.png

If there's no relationship, you can create this calculated measure and put it in Card,

Total Hours = 
CALCULATE(SUM('support calls'[hours]),FILTER('support calls','support calls'[category ]=SELECTEDVALUE(Category[category ])))

vxiaotang_1-1634617427015.png

 

Best Regards,

Community Support Team _Tang

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

Here's another way I'd like to present this problem.    I have one table that I want to display the # of hours and minutes worked.   When selecting each of the subcategories, I do see the sum of hours worked (top box), however, if I want to display the time as "hours" and "minutes", I don't get the same results (bottom box).Screenshot 2021-10-19 170500.png

Hi @creynolds 

Thanks for your reply.

I didn't reproduce the problem, could you provide a sample file for us to test?

vxiaotang_1-1634699112062.png

 

 

 

Best Regards,

Community Support Team _Tang

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

Here are my latest findings.   I've tried multiple attempts and can not get the desired outcome.   First, the Card does not dynamically change when selections are made on the table.   Second, time over 24 does not represent well with my example.   Below I have an example of the excel sheet showing events over 24 hours.  Next to that is how PowerBI displays the information both in the Table and Card when I use "Time Worked".

Screenshot 2021-10-22 121829.png

@creynolds - it looks like you're creating a calculated column, you may need to create this as a measure if you want it to be responsive to other interactions. Have a look at the links I posted above and try creating it as a new measure. 

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x

Lots of different ways to approach this.

This video shows one that you should be able to adapt to your needs.

https://www.youtube.com/watch?v=Z1hGU93UE1c&ab_channel=NestorAdrianzen

 

EDIT: another good option, https://radacad.com/calculate-duration-in-days-hours-minutes-and-seconds-dynamically-in-power-bi-usi... 

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x

I followed the YouTube example, and feel this is a good solution.   However, I have one error that I can't seem to resolve.   Everything looks accurate.  Any suggestions?Screenshot 2021-10-20 160419.png

In your return statement, I think you need to put a 'FORMAT' around the DaysInt. It will be trying to concatenate number with text. 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x
KNP
Super User
Super User

As long as your model has appropriate relationships defined you can just drag the 'Total Hours' column to the card.

Sample PBIX attached.

 

g4lt9slFOw.gif

 

Have I solved your problem?
Please click Accept as Solution so I don't keep coming back to this post, oh yeah, others may find it useful also ;).
chrome-9xf-Zagzel-B

If you found this post helpful, please give Kudos.
It gives me a sense of instant gratification and, if you give me Kudos enough times, magical unicorns will appear on your screen.
If you find my signature vaguely amusing, please give Kudos.
KIfp67uy-Sr
Proud to be a Super User!PBI-Super-User-Rank-30x30-1x

Helpful resources

Announcements
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors