cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
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 😞

 

koray_0-1599214691311.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
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.

View solution in original post

7 REPLIES 7
Highlighted
Super User II
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!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




Highlighted

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

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!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




Highlighted

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



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Highlighted

Hello @amitchandak @Pragati11 

 

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

Highlighted

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!
Did I answer your question? Mark my post as a solution!


Proud to be a Super User!




Highlighted
Community Support
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.

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors