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 dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
User | Count |
---|---|
75 | |
75 | |
45 | |
31 | |
27 |
User | Count |
---|---|
99 | |
89 | |
52 | |
48 | |
46 |