Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateJoin 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
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
62 | |
61 | |
55 | |
38 | |
27 |
User | Count |
---|---|
83 | |
61 | |
45 | |
41 | |
39 |