简体   繁体   English

Power Bi DAX:当月总计

[英]Power Bi DAX: Total for the month

I need to make a total for each of the months based on the working days.我需要根据工作日计算每个月的总数。

So far i have working days set as 1 if the day in the month is during Monday - Friday and 0 for Saturday and Sunday.到目前为止,如果一个月中的一天是在周一至周五,我将工作日设置为 1,周六和周日为 0。 I now need to total up the 1's and make it so that it is a single value for the month.我现在需要将 1 相加并使其成为该月的单个值。

Eg Going the weekdays is 1 and weekend is 0, January will have 22 days on each row on the table in the data mode - January 1 = 232 January 2 = 22 etc. so i can use it to divide against my target which is set to the 1st of every month.例如,工作日为 1,周末为 0,1 月将在数据模式下的表的每一行上有 22 天 - 一月 1 = 232 一月 2 = 22 等,所以我可以用它来划分我设定的目标到每个月的 1 号。

How can i do this??我怎样才能做到这一点??

日历表

try this.尝试这个。 i haven't tested it.我还没有测试过。

=GROUPBY( FILTER(table, table[Working_Day]=1) , table[Month], ["new col", SUMX( CURRENTGROUP(), table[Month_Order])]) 

filter gives working day 1's data as table,then group by performed by month, then month order has been added and returns table. filter 将第 1 个工作日的数据作为表格,然后按月分组,然后添加月订单并返回表格。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM