cancel
Showing results for
Did you mean:
Highlighted
Helper III

## How can I get use filtered value using IF

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 😞

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support

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.

7 REPLIES 7
Highlighted
Super User II

Hi @koray ,

You can create a column using the following DAX expression:

CalcCol = IF(UOMCode = "GRAM", DIVIDE(IssuedQuantitiy, 1000, 0), IssuedQuantitiy)

Thanks,

Pragati

If this helps, Appreciate a KUDOS!

Proud to be a Super User!

Highlighted
Helper III

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.

Highlighted
Super User II

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

If this helps, Appreciate a KUDOS!

Proud to be a Super User!

Highlighted
Super User IV

@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?

Proud to be a Super User!

Highlighted
Helper III

Also I want to add KG and ST quantities to the new column too. How should the whole coding be?

Highlighted
Super User II

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

If this helps, Appreciate a KUDOS!

Proud to be a Super User!

Highlighted
Community Support

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.

Announcements

#### Power Platform Community Conference

Check out the on demand sessions that are available now!

#### Microsoft Power Platform Communities

Check out the Winners!

#### Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors