Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
I have 2 columns, Num Hrs & DayName. How do I count the number of hrs in Num Hrs if DayName = Sunday?
Num Hrs is in Duration format, DayName is Text.
Regards,
Gerry
Solved! Go to Solution.
Hi,
Thanks for the reply. Yeah, SUM is what I meant. I have what I need using - Sunday Hrs = CALCULATE(SUM(CarerActualWork[Num Hrs]),CarerActualWork[DayName] = "Sun")
Thanks anyway.
Gerry
Just filter and sum (I think you mean "sum" instead of "count"):
let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content], #"Changed Type" = Table.TransformColumnTypes(Source,{{"Num Hrs", type duration}, {"Day", type text}}), #"Filtered Rows" = Table.SelectRows(#"Changed Type", each ([Day] = "Sunday")), #"Calculated Sum" = List.Sum(#"Filtered Rows"[Num Hrs]) in #"Calculated Sum"
Hi,
Thanks for the reply. Yeah, SUM is what I meant. I have what I need using - Sunday Hrs = CALCULATE(SUM(CarerActualWork[Num Hrs]),CarerActualWork[DayName] = "Sun")
Thanks anyway.
Gerry
Hi @android1,
Glad to hear the issue is solved. You can accept helpful replies as answers to close this thread.
Thanks,
Lydia Zhang
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
75 | |
68 | |
54 | |
37 | |
35 |
User | Count |
---|---|
65 | |
65 | |
59 | |
53 | |
45 |