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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Sriram_K
Helper I
Helper I

Unable to create a new column by using 2 measures(calculated)

Hi,

 

If statement is not working for decimal numbers.
Example:

Excepted PriceActual PriceOutput as Validated Coming from Switch
100.25101.45Needs ReviewValidated 
35.7624.54Validated Validated
45.6525.43ValidatedValidated
 0.00Not ChargedValidated
95.45100.25Needs ReviewValidated
 0.00Not ChargedValidated


I want to create a colume as validation status colume.by using Switch statement,Actual Price & Expected Price are calculated Measure.

Switch satement 

Validation Status = SWITCH (
TRUE (),
[Actual Price]>[Expected Price],"Needs Review",
[Actual Price]=0,"Not Charged",
[Actual Price]<=[Expected Price],"Validated"
)

Please help me 
4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

@Sriram_K - Would need to see the formulas for your measures as well as sample source data. I mocked up what you gave us. See attached PBIX file Table (9), Page (9). Seems to work but who knows what is really going on with your data and measure calculations.

 

Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi,

Thanks for your response, i want that as a colume.

Thanks & Regards,

Sriram.K

Anonymous
Not applicable

Hi @Sriram_K ,

I just try to reproduce your problem, but it can get the correct status(see below screen shot)...Could you please provide some sample data which involve in your visuals with screen and the formula of measure "Excepted Price" and "Actual Price" in order to make troubleshooting and provide a proper solution? In addition, confirm with you that you want to create a calculated column rather than a measure to obtain the validation status, right?

validation status.JPG

Best Regards

Rena

amitchandak
Super User
Super User

@Sriram_K , check the datatype of the column. Tray a new column like

 

Validation Status = SWITCH (
TRUE (),
[Actual Price]=0,"Not Charged",
[Actual Price]*1.0>[Expected Price]*1.0,"Needs Review",
[Actual Price]*1.0<=[Expected Price]*1.0,"Validated"
)

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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