Forum Discussion

Yannick_M's avatar
Yannick_M
New Member
3 years ago
Solved

Double Values

Hello

I need help on a table.

I would like to add a calculated column that gives me back a D or R value.
R if the value is not double.
D if the value is doubled

Here are the columns

id usersRoomYearColumn measured
id11112010 
id33312010 
id111112011D
id33322011R

 

i know the algorithm, but i dont scrive this in dax

i must to look if my room users is same than one year ago, if yes the result will be D or not then result is R

 

i think to use parallellperiod or sameperiodlast year, but i'm blocked on filter to use that

 

Sorry for my english

 

i hope someone will can to help me

 

Regards

 

  • Thx for you help, i just modified year +1 on year -1 for result D on first... in my case.. room student...

    For understand, if i want compare two values, i must to create variable if i want filter? 

3 Replies

  • Hi Yannick_M 

    you can try to create a new column with this:

    Column =
    VAR CurrentID = TableName[ID]
    VAR CurrentRoom = TableName[Room]
    VAR CurrentYear = TableName[Year]
    VAR _count=
    COUNTROWS(
        FILTER(
            TableName,
            CurrentID = TableName[ID]
                &&CurrentRoom = TableName[Room]            
                &&CurrentYear = TableName[Year]+1
        )
    )
    RETURN IF(_count=1, "D","R")

    i tried and it worked like this:

     

    • Yannick_M's avatar
      Yannick_M
      New Member

      Thx for you help, i just modified year +1 on year -1 for result D on first... in my case.. room student...

      For understand, if i want compare two values, i must to create variable if i want filter? 

  • v-xiaotang's avatar
    v-xiaotang
    Community Support

    Hi Yannick_M 

    Thanks for reaching out to us.

    I just want to confirm if you resolved this issue? If yes, you can accept the answer helpful as the solution or share you method and accept it as solution, thanks for your contribution to improve Power BI.

    If you need more help, please let me know.

     

    Best Regards,

    Community Support Team _Tang

    If this post helps, please consider Accept it as the solution to help the other members find it more quickly.