Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Custom Division

Hi,

Before explaining the problem, let me paste sample data set.

 

DateNameValue
01-Jul-22G10
02-Jul-22G20
03-Jul-22G30
04-Jul-22G40
05-Jul-22G50
01-Jul-22O60
02-Jul-22O70
03-Jul-22O80
04-Jul-22O90
05-Jul-22O100
01-Jul-22C110
02-Jul-22C120
03-Jul-22C130
04-Jul-22C140
05-Jul-22C150

 

I want to create a measure which will divide only "G" and "C" values with a certain number let's say 10.

 

  • Hi,

    Try something like this:

    DAX:

    Divide G and C =
    IF(MAX('Table'[Name]) in {"G","C"},
    DIVIDE(MAX('Table'[Value]),10)
    ,MAX('Table'[Value]))


    End result;

    I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

    My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/



1 Reply

  • ValtteriN's avatar
    ValtteriN
    Community Champion

    Hi,

    Try something like this:

    DAX:

    Divide G and C =
    IF(MAX('Table'[Name]) in {"G","C"},
    DIVIDE(MAX('Table'[Value]),10)
    ,MAX('Table'[Value]))


    End result;

    I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

    My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/