Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi,
If statement is not working for decimal numbers.
Example:
Excepted Price | Actual Price |
100.25 | 101.45 |
35.76 | 24.54 |
45.65 | 25.43 |
0.00 | |
95.45 | 100.25 |
0.00 |
I want to create a colume as validation status colume.by using Switch statement geeting same result.
Switch satement
Solved! Go to Solution.
Hi @Sriram_K
take care about the order in SWITCH() function:
With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)
@Sriram_K , the should have work. Just check the data type
You are creating a new column and [Actual Price], [Expected Price] are columns
Switch satement
SWITCH (
TRUE (),
[Actual Price]>[Expected Price],"Needs Review",
[Actual Price]<=[Expected Price],"Validated",
[Actual Price]=0,"Not Charged")
Hi @Sriram_K
take care about the order in SWITCH() function:
With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)
Hi,
When i creted this as a measure it's working but when i create it as a column getting incorrect result.
i want to use result column(Validation) as a slicer.
Can any once help me to Change this measure as working column.
Thanks,
Sriram.K
hi @Sriram_K ,
Can you please add detail on the expected output?
You haven't mentioned what you are currently getting problem with decimal numbers.
Please add detail this is not helping me much.
Thanks,
Pragati
Hi,
Excepted Price | Actual Price | Expected Output | Getting from Switch statement |
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 |
Data type is rounded value as 2 decimal.
Hi @Sriram_K
if you need it as a measure try the following solution:
Validation Measure =
SWITCH(TRUE(),
MIN('Table'[Actual Price]) > MIN('Table'[Excepted Price]), "Needs Review",
MIN('Table'[Actual Price]) = 0, "Not Changed",
MIN('Table'[Actual Price]) <= MIN('Table'[Excepted Price]), "Validated"
)
With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)
Proud to be a Super User!
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |