English 中文(简体)
序言
原标题:DAX FORMULA ERROR USING VAR AND CALCULATE

我采用以下公式,但我没有像我所希望的那样获得变化:

DoD% de MB2200 = 
    VAR FechaElegida=SELECTEDVALUE(DIM_FECHAS[FCH_LABORABLE_ANT])
    VAR __PREV_DAY =
        CALCULATE(
            SUM( DATAMATRIX [MB2200]),
             DIM_FECHAS [FECHAID].[Date]=FechaElegida
        )
    RETURN
        SUM( DATAMATRIX [MB2200]) - __PREV_DAY

To clarify I want to obtain the difference when I filter by the FECHAID (For example, for the date 29dec23 and fila_balance=11 DoD de MB2200 should be 569.09-567.82=1.27 but I have 569.09) enter image description here

我有以下表格:

  • DIM_FECHAS: FECHAID (date), FCH_LABORABLE_ANT(Previous working day)
  • DATAMATRIX: FECHAID (date), MB2200(amount of which I want to obtain the difference with the previous working date), fila_balance(Identification of certain information)

提前感谢。

问题回答

用<代码>进行查询 排 定 的

DoD% de MB2200 = 
  VAR __PREV_DAY =
    CALCULATE(
      SUM( DATAMATRIX [MB2200]),
      PREVIOUSDAY(  DIM_FECHAS [FECHAID])
    )
    RETURN
      SUM( DATAMATRIX [MB2200]) - __PREV_DAY

你目前的表达甚至没有试图看上去。





相关问题
Advanced visualization options for ASP.NET

I m looking for ways to present statistical information in my ASP.NET web application. Ease of use is not a priority: I have tried "Microsoft Chart Controls for Microsoft .NET Framework 3.5" and would ...

Flipping the Y axis in vtk

Is there a way that I can make VTK have the Y axis go down (when increasing values) rather than up? I d like my VTK windows to match my non-VTK windows in displaying data, which all have the Y axis ...

Introduction to Java Graphics Libraries

I just got into information-visualization and scientific-visualization and have been using Piccolo and a little with JFreeChart. I am trying to find a few new libraries that I can start using. I am ...

Mersenne Twister: seeding & visualization

I am using a C# implementation of Mersenne Twister I downloaded from CenterSpace. I have two problems with it: No matter how I seed the algorithm it does not pass DieHard tests, and by that I mean I ...

Real-time audio visualisation in Cocoa? [closed]

Are there any frameworks or open-source code that would simplify the process of implementing a real-time oscilloscope (time-domain audio visualisation) in OSX? Ideally, I want to display a simple ...

热门标签