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
Anonymous
Not applicable

Create measure that calculates different things based on value in another column

Hi,

 

I have a scenario where I would like to divide two measures I have created, but there is one case where i would like to calculate the percentage differently. 

The measures I have are:

1 - [Number of items]

2 - [$ Profit]

 

For all cases but one a simple 

test = DIVIDE([Number of items], [$ Profit])
 
But I have one case, where I need to divide the numerater by 4.
This is based on a column called "item name" = "togsett"
Is there a way to input this filter in my measure so i can have it all show in one table?
I'm thinking something like this:
% test =
if( 'xyz'$item name = "togsett",
DIVIDE(Divide([Number of items], 4) , [$ Profit]),
DIVIDE([Number of items], [$ Profit]))
 
This is wrong since the if statement can't use the true value as a column value.
Any other suggestions on how to do this?
 
Thanks!
1 ACCEPTED SOLUTION
saraMissBI
Resolver I
Resolver I

Hi @Anonymous 

I suggest you create a calculated column and put the formula you have as it will accept it or create a second measure for that special case and work with two measures. If anyone has a better solution, I would be curious to know

If my reply helps please give kudos 🙂

Thanks!

View solution in original post

1 REPLY 1
saraMissBI
Resolver I
Resolver I

Hi @Anonymous 

I suggest you create a calculated column and put the formula you have as it will accept it or create a second measure for that special case and work with two measures. If anyone has a better solution, I would be curious to know

If my reply helps please give kudos 🙂

Thanks!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.