简体   繁体   English

Power BI中“一天的总列数”

[英]Day's Total Column in Power BI

I'm struggling with what should be some simple DAX. 我正在努力使用一些简单的DAX。

Given a 'Booking' Table: 给定一个“预订”表:

  • Date 日期

  • User 用户

  • Booking# 预订号

I want to create a column for the days total but I want it on the 'Booking' table. 我想为总天数创建一列,但我希望在“预订”表上。

Previously I had achieved this by putting the total on my Date table. 以前,我是通过将总计放入“日期”表来实现的。 But I don't want to continue that pattern going forward. 但我不想继续这种模式。

The DAX for the total column on the date table: 日期表上总计列的DAX:

  • Sum = CALCULATE(SUM(Booking[Booking]), Booking[Date]) 总和= CALCULATE(SUM(Booking [Booking]),Booking [Date])

If I understand you correctly, you're trying to count the bookings you have. 如果我对您的理解正确,则您正在尝试计算您的预订量。 You might try the DistinctCount DAX function over Booking[Booking#]. 您可以在Booking [Booking#]上尝试使用DistinctCount DAX函数。 Then if you use the date from the date table it will automatically filter the booking numbers. 然后,如果您使用日期表中的日期,它将自动过滤预订号。

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

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