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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Julius410
Frequent Visitor

IF Formula Calculated Column

Hi there,

 

I am trying to create a calculated column that allows me to differentiate between projects that have a budget and projects with no budget. Currently, I am using the following formula:

 

Budgeted = IF( 'Impacts Final'[Budget] = 0, "Budget N/A", "Budgeted")
 
Unfortunately, Power BI does not display the desired outcome. It displays the correct classification of budgeted and non-budgeted projects. It does not display forecasted or actual values for the "Budgeted" projects. However, it does display actual and forecasted values for projects with "Budget N/A". Please see screenshot below:
 
Projects.PNG
 
Can someone help me to solve this issue?
 
Thank you.
 
Julius
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Julius410 ,

 

You could create a dynamic measure to display the budget value.

Before you create the measure, create a table with the following values for the slicer.

You can create it by entering data.

vstephenmsft_0-1658477068534.png

Then create the measure.

Budget value =
SWITCH (
    SELECTEDVALUE ( 'For Slicer'[Budgeted] ),
    "Budgeted", CALCULATE ( SUM ( 'Table'[Budget] ), FILTER ( 'Table', [Budget] > 0 ) ),
    "Budget N/A", BLANK ()
)

 Here's the results. When you select 'Budgeted' in the slicer,

vstephenmsft_1-1658477301844.png

When you select 'Budget N/A' in the slicer,

vstephenmsft_2-1658477326355.png

Hope to help you.

 

Best Regards,

Stephen Tao

 

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

4 REPLIES 4
Julius410
Frequent Visitor

Hi @Anonymous 

 

Thanks so much for your extensive reply and the detailed explantion.

 

Your solution is getting close. However, it's still not exactly what I wanted. The problem is that the number initiatives stay the same regardless of which filter is selected. Please see below the screenshot for slicer "Budgeted":

 

Budgeted.PNG

 

Please see below screenshot for slicer "Budget N/A":

 

NA.PNG

 

I would like the initiatives that do not have a budgeted value against them filtered out when I select "Budget N/A".

 

Do you think that this is possible?

 

Thanks.


Julius

amitchandak
Super User
Super User

@Julius410 , Not very clear,

 

You can have

Budgeted value 1= IF( 'Impacts Final'[Budget] = 0, [Budget], [Forecast])

 

Budgeted value 2= IF( 'Impacts Final'[Budget] = 0, [Budget], [Actual])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak,

 

Thanks for your reply but this doesn't fix my issue. I'll try to explain it better.

 

I need a slicer that allows me to differentiate between projects which have a budget (>0) and projects which do not have a budget (<=0 or =BLANK()). When I select the filter for budgeted projects it should still display the data that sits in in the Actual and Forecast column. Currently, this is not the case.

 

Any idea how I can achieve that?

 

Thank you.

 

Julius

Anonymous
Not applicable

Hi @Julius410 ,

 

You could create a dynamic measure to display the budget value.

Before you create the measure, create a table with the following values for the slicer.

You can create it by entering data.

vstephenmsft_0-1658477068534.png

Then create the measure.

Budget value =
SWITCH (
    SELECTEDVALUE ( 'For Slicer'[Budgeted] ),
    "Budgeted", CALCULATE ( SUM ( 'Table'[Budget] ), FILTER ( 'Table', [Budget] > 0 ) ),
    "Budget N/A", BLANK ()
)

 Here's the results. When you select 'Budgeted' in the slicer,

vstephenmsft_1-1658477301844.png

When you select 'Budget N/A' in the slicer,

vstephenmsft_2-1658477326355.png

Hope to help you.

 

Best Regards,

Stephen Tao

 

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.