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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
smiler2021
Regular Visitor

Calculated column

Hi all,

 

Would be great if somebody could help with the following issue:

 

I have two fact sheets in my power BI (one for budget one for actual)  and i have made a calculated table to link those two with project number:

Calculated Table:
Dim Project Numbers = DISTINCT(UNION(
ALL([BudgetTable]Column)
ALL([AcutalTable]Column)
))

 

This works fine. But I would like to add in this calculated table as well description of the projects. Descriptions are not exactly the same in actual and budget and not all budget projects already exist in actual already.

 

Therefore I would like to use:

Actual description if available,

if no actual description available, description from the budget.

 

Can somebody help to solve?

Thanks!!!!

 

BR

1 ACCEPTED SOLUTION
v-chenwuz-msft
Community Support
Community Support

Hi @smiler2021 ,

 

My example data:

[AcutalTable]

vchenwuzmsft_0-1636359169628.png

[BudgetTable]

vchenwuzmsft_1-1636359235282.png

try this dax to creata a new column:

Column =
VAR _a =
    CALCULATE(
        MAX( 'AcutalTable'[description] ),
        FILTER(
            AcutalTable,
            [ProjectID] = EARLIER( 'Dim Project Numbers'[ProjectID] )
        )
    )
VAR _b =
    CALCULATE(
        MAX( 'BudgetTable'[description] ),
        FILTER(
            BudgetTable,
            [ProjectID] = EARLIER( 'Dim Project Numbers'[ProjectID] )
        )
    )
RETURN
    IF( ISBLANK( _a ), _b, _a )

 and result:

vchenwuzmsft_2-1636359297109.png

I put my pbix file in the attachment you can refer.

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
smiler2021
Regular Visitor

Hi,

Thanks you, great :-), it works.

BR,

v-chenwuz-msft
Community Support
Community Support

Hi @smiler2021 ,

 

My example data:

[AcutalTable]

vchenwuzmsft_0-1636359169628.png

[BudgetTable]

vchenwuzmsft_1-1636359235282.png

try this dax to creata a new column:

Column =
VAR _a =
    CALCULATE(
        MAX( 'AcutalTable'[description] ),
        FILTER(
            AcutalTable,
            [ProjectID] = EARLIER( 'Dim Project Numbers'[ProjectID] )
        )
    )
VAR _b =
    CALCULATE(
        MAX( 'BudgetTable'[description] ),
        FILTER(
            BudgetTable,
            [ProjectID] = EARLIER( 'Dim Project Numbers'[ProjectID] )
        )
    )
RETURN
    IF( ISBLANK( _a ), _b, _a )

 and result:

vchenwuzmsft_2-1636359297109.png

I put my pbix file in the attachment you can refer.

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.