Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Yannick_M
New Member

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

 

1 ACCEPTED SOLUTION

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? 

View solution in original post

3 REPLIES 3
v-xiaotang
Community Support
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.

FreemanZ
Super User
Super User

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:

FreemanZ_0-1670417266518.png

 

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? 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.