Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Ortignano
Helper I
Helper I

Debugging measure (How refer to columns of a table variable)

Hi all,

I'm in trouble to a standard deviation calculation (last 12 months) as my measure give me a results different from excel, so I would debug the formula.

The formula start with 

STD:=

VAR LastMonthID =
MAX ( 'Calendar'[MonthID] )
VAR FirstMonthID = LastMonthID - 11
VAR Months =
FILTER (
ALL ( 'Calendar'[MonthID] );
'Calendar'[MonthID] >= FirstMonthID
&& 'Calendar'[MonthID] <= LastMonthID
)

VAR MOnthlyQty =
ADDCOLUMNS ( Months; "Qty"; [Total_Case] +0)

FirstMonthID and LastMOnth ID works well but I'm not able to refer to column Qty to check if it's all correct.

Do you have any suggestion?

 

Thanks in advance

Antonio

1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

You could use CONCATENATEX to see a list of each of the [Qty].

 

STD :=
VAR LastMonthID =
    MAX ( 'Calendar'[MonthID] )
VAR FirstMonthID = LastMonthID - 11
VAR Months =
    FILTER (
        ALL ( 'Calendar'[MonthID] );
        'Calendar'[MonthID] >= FirstMonthID
            && 'Calendar'[MonthID] <= LastMonthID
    )
VAR MOnthlyQty =
    ADDCOLUMNS ( Months; "Qty"; [Total_Case] + 0 )
RETURN
    CONCATENATEX ( MOnthlyQty; [Qty]; "," )

View solution in original post

2 REPLIES 2
AlexisOlson
Super User
Super User

You could use CONCATENATEX to see a list of each of the [Qty].

 

STD :=
VAR LastMonthID =
    MAX ( 'Calendar'[MonthID] )
VAR FirstMonthID = LastMonthID - 11
VAR Months =
    FILTER (
        ALL ( 'Calendar'[MonthID] );
        'Calendar'[MonthID] >= FirstMonthID
            && 'Calendar'[MonthID] <= LastMonthID
    )
VAR MOnthlyQty =
    ADDCOLUMNS ( Months; "Qty"; [Total_Case] + 0 )
RETURN
    CONCATENATEX ( MOnthlyQty; [Qty]; "," )

Thank you very much. Now it works.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors