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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

modify my measure using if

Im looking for a measure formula

I have a data table. In this table I have a column called account type (text).

In this ‘table’ I also create a measure (number).

 

What I would like to have: if the account type column=rev my measure need to multiple by -1, otherwise I need to show my original measure value.

 

In excel it’s a simple IF AND , however in PowerBI looks like to me for if and I can only use my measures as a variable, not the columns that already exist? Am I right?

 

When I tried to create if and formula I have the following error.a single vales for column accont type in table cannot be determined.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try like

new Measure =
calculate(-1*[measure],[account type] = "rev")+ calculate([measure],[account type] <> "rev")

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

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , Try like

new Measure =
calculate(-1*[measure],[account type] = "rev")+ calculate([measure],[account type] <> "rev")

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

hi all

thank you @az38 I am not an expert in powerBI but when I tried to copy your technique, I had an error.
thank you@amitchandak, I also try this solutions and its worked

THank you 4 everybody!

az38
Community Champion
Community Champion

Hi @Anonymous 

try this technique

Measure = 
var _type = MAX(Table[account type])
var _measure = --YOURMEASURESTATEMENT--
RETURN
IF(_type = "rev", -1 * _measure , _measure )

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.