Search code examples
powerbiformuladaxcalculated-columns

New Column is Doubling Value Based on Nested If Formula


I have a table that looks like this. Table Screenshot

"FY 20-21 (Budgeted)", "FY21 Approved Budget" and "Revised Budget" are columns coming from three different data sources that I appended into one table. There isn't always data in all three of these columns, so I created a new column to consolidate the data with the following formula:

FY 20-21 Budget = 
if(
    and(
        isblank('Comprehensive Budget'[FY 20-21 (Budgeted)]),
        isblank('Comprehensive Budget'[FY21 Approved Budget])
    ),
    'Comprehensive Budget'[Revised Budget],
    if(
        and(
            isblank('Comprehensive Budget'[FY21 Approved Budget]),
            isblank('Comprehensive Budget'[Revised Budget])
        ),
        'Comprehensive Budget'[FY 20-21 (Budgeted)],
        'Comprehensive Budget'[Revised Budget]
    )
)
  1. If both Budgeted and Approved are blank, use Revised.
  2. If not, if both Revised and Approved are blank, use Budgeted.
  3. If not, use Revised.

But if you look on the screenshot, if NONE of the columns are blank, it gives me Revised plus Budgeted. Where is the problem in my formula?


Solution

  • I have added your data here and found your Measure is perfectly returning your expected data as shown in the below image-

    enter image description here

    I Guess, there are some Aggregation issue in your case. You can right click on all column in the table visual properties and select Don't Summarize from the options. This should solve your issue I hope.