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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Ortignano
Helper II
Helper II

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors