Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi,
If statement is not working for decimal numbers.
Example:
Excepted Price | Actual Price | Output as Validated | Coming from Switch |
100.25 | 101.45 | Needs Review | Validated |
35.76 | 24.54 | Validated | Validated |
45.65 | 25.43 | Validated | Validated |
0.00 | Not Charged | Validated | |
95.45 | 100.25 | Needs Review | Validated |
0.00 | Not Charged | Validated |
I want to create a colume as validation status colume.by using Switch statement,Actual Price & Expected Price are calculated Measure.
Switch satement
@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.
Hi,
Thanks for your response, i want that as a colume.
Thanks & Regards,
Sriram.K
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?
Best Regards
Rena
@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"
)