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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors