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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
JustDavid
Helper IV
Helper IV

How to debug DAX measure that result in table

Hello,

 

As the subject says, am wondering if there's a way to know the result/output of a measure that resulted in a table?

 

For example, I have a measure below, as you can see, I have _table1.

 

If I want to break down the formula and see the output, from FILTER function, all the way to the AddColumns, is there a way to do it?

 

Thanks

 

MEASURE =
VAR _obj =
    SELECTEDVALUE ( 'Table'[obj code] )
VAR _cost =
    SELECTEDVALUE ( 'Table'[cost code] )
VAR _id =
    SELECTEDVALUE ( 'Table'[id] )
VAR _table1 =
    ADDCOLUMNS (
        'tbl_Tier1',
        "c1",
            SUMX (
                FILTER (
                    mirrorFactTableWithAllCostCodes,
                    [id] = EARLIER ( tbl_Tier1[T1_From] )
                        && [obj code] = _obj
                        && [cost code] = _cost
                ),
                [Column]
            ) * [T1_Alloc]
    )
VAR _table2 =
    ADDCOLUMNS (
        'tbl_Tier2',
        "c1",
            VAR _result =
                (
                    SUMX ( FILTER ( _table1, [T1_To] = EARLIER ( tbl_Tier2[T2_From] ) ), [c1] )
                        + SUMX (
                            FILTER (
                                'mirrorFactTableWithAllCostCodes',
                                [id] = EARLIER ( tbl_Tier2[T2_From] )
                                    && [obj code] = _obj
                                    && [cost code] = _cost
                            ),
                            [Column]
                        )
                ) * [T2_Alloc]
            RETURN
                IF ( ISBLANK ( _result ), 0, _result )
    )
VAR _table3 =
    ADDCOLUMNS (
        'tbl_Tier3',
        "c1",
            VAR _result =
                (
                    SUMX ( FILTER ( _table2, [T2_To] = EARLIER ( tbl_Tier3[T3_From] ) ), [c1] )
                        + SUMX (
                            FILTER (
                                'mirrorFactTableWithAllCostCodes',
                                [id] = EARLIER ( tbl_Tier3[T3_From] )
                                    && [obj code] = _obj
                                    && [cost code] = _cost
                            ),
                            [Column]
                        )
                ) * [T3_Alloc]
            RETURN
                IF ( ISBLANK ( _result ), 0, _result )
    )
RETURN
    SUMX ( FILTER ( _table3, [T3_To] = _id ), [c1] )
        + SUMX (
            FILTER (
                'mirrorFactTableWithAllCostCodes',
                [id] = _id
                    && [cost code] = _cost
                    && [obj code] = _obj
            ),
            [Column]
        )
3 REPLIES 3
JustDavid
Helper IV
Helper IV

Thank you both @quantumudit and @Fowmy. I'll have a look at both

quantumudit
Super User
Super User

Hello  I use DAX Query View for debugging my DAX expressions. Here is a screenshot of working with DAX Query View:

 

quantumudit_0-1739859549375.png

 

You may watch the following video to understand how to work with DAX Query View:
Unboxing DAX Query View in Power BI - Unplugged #54 

 

 

Best Regards,
Udit

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudo 👍

🚀 Let's Connect: LinkedIn || YouTube || Medium || GitHub
Visit My Linktree:
LinkTree

Proud to be a Super User

Fowmy
Super User
Super User

@JustDavid 

I use the TOCSV function which concatenates the values shows as a scaler value
Here is an example:

 

TOCSV ( VALUES ( 'Date'[Calendar Year Quarter] ) )

 


More on his function: TOCSV function (DAX) - DAX | Microsoft Learn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.