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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
WhaleWatcher222
Helper II
Helper II

Add back another measure if the current measure returns a blank

Hi Expert

 

See table below if column A has a Value and Column B is blank then see result column likewise of column A is Blank and Column B has a Value see results column... 

Column AColumn BResult
2 2
2 2
 55
3 3
3 3

 

I am trying to do this with my measure but the measure gives me either or..

 

Result = 
VAR _AddbackActuals = CALCULATE(SUM('F Datasets'[Amount]), FILTER('F Datasets','F Datasets'[Forecasts-Actuals] = "A"),
    REMOVEFILTERS('F Datasets'[Dataset]),
    REMOVEFILTERS('F Datasets'[Budget Name])
)
RETURN
    if(_AddbackActuals = Blank(), [Total F])

Where _AddbackActuals are the Values in Column A and [Total F] should be the values in column B 

1 ACCEPTED SOLUTION
danextian
Super User
Super User

I am not exactly sure what you're trying to achieve but you could use COALESCE to return the first non-blank value among a list of values. Example:

COALESCE ( [columnA measure], [columnB measure] )




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

3 REPLIES 3
danextian
Super User
Super User

I am not exactly sure what you're trying to achieve but you could use COALESCE to return the first non-blank value among a list of values. Example:

COALESCE ( [columnA measure], [columnB measure] )




Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
PijushRoy
Super User
Super User

Hi @WhaleWatcher222 

Please try this DAX

Result = 
VAR _AddbackActuals = CALCULATE(SUM('F Datasets'[Amount]), FILTER('F Datasets','F Datasets'[Forecasts-Actuals] = "A"),
    REMOVEFILTERS('F Datasets'[Dataset]),
    REMOVEFILTERS('F Datasets'[Budget Name])
)
RETURN
    If(ISBLANK(_AddbackActuals),[Total F],_AddbackActuals)



Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





audreygerred
Super User
Super User

Hi! Here is the measure I created to test it out and appears to be working:

DynamicSum =
IF(
    ISBLANK(SUM([Column B])),
    SUM([Column A]),
    IF(
        ISBLANK(SUM([Column A])),
        SUM([Column B]),
        BLANK()
    )
)
 
audreygerred_0-1742415704133.png

 

 

If you need the result (dynamic sum) measue to also sum the values, you can use this instead:

DynamicSum2 =
SUMX(
    'Table',
    IF(
        ISBLANK('Table'[Column B]),
        'Table'[Column A],
        IF(
            ISBLANK('Table'[Column A]),
            'Table'[Column B],
            'Table'[Column A] + 'Table'[Column B]
        )
    )
)
audreygerred_1-1742415906788.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





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.