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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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