DAX倒计时(剩余)

时间:2017-10-26 08:54:07

标签: excel powerbi powerpivot dax ssas-tabular

我想在DAX中计算列RestOrder。你能帮忙吗? TotalOrderDay列是使用Allexcept()公式计算的。我需要像计算Statedate剩余左右的订单......或者SQL" rownumber over partition by kinda"。

https://i.stack.imgur.com/wRbhB.jpg

感谢您的帮助!

1 个答案:

答案 0 :(得分:1)

以下DAX可以:

@Override
public void onBindItemViewHolder(final KolamViewHolder holder, final int itemPosition) {
    Log.e("BaseAdapter", galleryList.get(itemPosition).getImage());
    Glide.with(context).load(galleryList.get(itemPosition).getImage().trim())
            .diskCacheStrategy(DiskCacheStrategy.SOURCE)
            .dontAnimate()
            .override(150,150)
            .listener(new RequestListener<String, GlideDrawable>() {
        @Override
        public boolean onException(Exception e, String model,
                                   Target<GlideDrawable> target, boolean isFirstResource) {
            Toast.makeText(context, e.getMessage(), Toast.LENGTH_SHORT).show();
            holder.progressBar.setVisibility(View.GONE);
            return false;
        }

        @Override
        public boolean onResourceReady(GlideDrawable resource, String model,
                                       Target<GlideDrawable> target, boolean isFromMemoryCache,
                                       boolean isFirstResource) {
            holder.progressBar.setVisibility(View.GONE);
            return true;
        }
    }).into(holder.kolamImage);
}

结果:

results

因此,您尝试实现的目标是计算订单数量,这些订单的数量相同但早于其他订单。

为了实现这一目标,您的RestOrder = COUNTROWS( FILTER( 'Order', 'Order'[StateDate].[Date] = EARLIER('Order'[StateDate].[Date]) && 'Order'[StateDate] >= EARLIER('Order'[StateDate]) ) ) 必须为Statedate类型。