Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
In my table, I need information about the amount of products linked to the relevant orders.
I want to divide the GRM quantities by the number 1000 for the calculation in my table to work correctly.
How can I do this using IF in a new column.
If what I want is the "IssuedQuantitiy" column and the "UOMCode" value is GRAM, then the "IssuedQuantitiy" / 1000 will appear in the new column. If "UOMCode" is ST and KGM, then "IssuedQuantitiy" value should be the same.
Sorry for my bad English 😞
Solved! Go to Solution.
Hi @koray ,
Please check if the expressions below are what you want:
Column =
IF (
[UOMCode] = "GRM",
[IssuedQuantitiy] / 1000,
IF ( [UOMCode] IN { "ST", "KGM" }, [IssuedQuantitiy] )
)
Column =
IF (
[UOMCode] IN { "GRM", "ST", "KGM" },
[IssuedQuantitiy] / 1000,
[IssuedQuantitiy]
)
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @koray ,
You can create a column using the following DAX expression:
CalcCol = IF(UOMCode = "GRAM", DIVIDE(IssuedQuantitiy, 1000, 0), IssuedQuantitiy)
Thanks,
Pragati
Unfortunately it didn't work 😞 And I want to get all of KG, GRM and ST quantity values. I just want it to be GRM ones / 1000.
@koray , a formula like this should have worked as new column
if([UOMCode] ="GRAM", [IssuedQuantitiy]/1000.0,[IssuedQuantitiy])
if([UOMCode] ="GRM", [IssuedQuantitiy]/1000.0,[IssuedQuantitiy])
Can you share sample data and sample output in table format?
Hello @amitchandak @Pragati11
Also I want to add KG and ST quantities to the new column too. How should the whole coding be?
Hi @koray ,
Please check if the expressions below are what you want:
Column =
IF (
[UOMCode] = "GRM",
[IssuedQuantitiy] / 1000,
IF ( [UOMCode] IN { "ST", "KGM" }, [IssuedQuantitiy] )
)
Column =
IF (
[UOMCode] IN { "GRM", "ST", "KGM" },
[IssuedQuantitiy] / 1000,
[IssuedQuantitiy]
)
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @koray ,
Your requirement is getting confusing now.
You wanted a column with values against your categories - KG, GRAM, etc.
Please share more details. Create a sample data and from that share what output is expected. You are not clear on what you want.
Thanks,
Pragati
Hi @koray ,
Can you share the column dax expression that you created?
Because the dax expression I sugested should work.
Also what are data-types of your column? IssuedAmount should be numeric, other column should be Text.
Thanks,
Pragati
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
99 | |
75 | |
73 | |
49 |
User | Count |
---|---|
145 | |
109 | |
109 | |
90 | |
64 |