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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Mihail_C
Frequent Visitor

Sum IF or something else

Hello community,

 

I am new to PowerBI and still struggling to understand what would be the best solution for my problem.

 

I have a table that holds a report type which is text value ('P&L', 'CAPEX', 'ASSET') and a budget column that holds numerical values.

 

We used for now data for the first two report types until now and the budget was just a measure that divided by 1000 to keep the numbers low and more easily readable.

 
Budget_K = sum('FinMgmt_FY23'[Budget])/1000
 
Now, after inserting ASSET data, which is basically asset count, not asset cost, the report is not looking as great. I am trying to see what DAX function would be more appropriate to show [Budget])/1000 when the report type is ('P&L', 'CAPEX') and to show just [Budget] value when report type is 'ASSET'.
 
The report is now filtered based on report type via a slicer.
I tried to check an IF clause but is not working for me because the report type is not a measure so i cant select it in IF clause.
 
Any help would be appreciated.
 
Thank you
 
 
1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@Mihail_C 

You can use the new preview feature for 'Dynamic format string for measures' to accomplish what you are looking for. 
Go to File > Options and settings > Options and enable the feature:

jdbuchanan71_0-1684341288827.png

 

There is more information about the feature here:  https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-dynamic-format-strings

 

Then you have a measure that sums up your budget amount and also has the dynamic formatting code.

Measure:

 

Budget Amount = SUM ( FinMgmt_FY23[Budget] )

 

Format:

 

SWITCH (
    SELECTEDVALUE ( FinMgmt_FY23[Report Type] ),
    "ASSET", "#,0",
    "#,0,. K"
)

 

 

Here is what the formatted measure looks like vs the raw data:

jdbuchanan71_1-1684335558143.png

I have attached my sample file for you to look at. 

Finally, a shout out to @parry2k  for his excellent video on number formatting using the new feature.  https://www.youtube.com/watch?v=tTNkPesnx5M

 

 

 

 

View solution in original post

3 REPLIES 3
Mihail_C
Frequent Visitor

Oh had no idea about this. Thank you for the help - now i gotta go play with formatting 🙂

parry2k
Super User
Super User

Thanks for the shout out @jdbuchanan71!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

jdbuchanan71
Super User
Super User

@Mihail_C 

You can use the new preview feature for 'Dynamic format string for measures' to accomplish what you are looking for. 
Go to File > Options and settings > Options and enable the feature:

jdbuchanan71_0-1684341288827.png

 

There is more information about the feature here:  https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-dynamic-format-strings

 

Then you have a measure that sums up your budget amount and also has the dynamic formatting code.

Measure:

 

Budget Amount = SUM ( FinMgmt_FY23[Budget] )

 

Format:

 

SWITCH (
    SELECTEDVALUE ( FinMgmt_FY23[Report Type] ),
    "ASSET", "#,0",
    "#,0,. K"
)

 

 

Here is what the formatted measure looks like vs the raw data:

jdbuchanan71_1-1684335558143.png

I have attached my sample file for you to look at. 

Finally, a shout out to @parry2k  for his excellent video on number formatting using the new feature.  https://www.youtube.com/watch?v=tTNkPesnx5M

 

 

 

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors