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
Anonymous
Not applicable

Power BI DAX: refer to a defined pair of values within the same table to fill column

Hi!

 

i'm trying to connect a session ID with the e-mail associated to that ID. My table creates this pair only when someone signs in, so out of all the same session ID number just one is paired with an e-mail. I want to fill out the column of e-mail knowing this relationship.

 

SessionIDUserLoginName
HJK9877some@mail.com
HJK9877 
HJK9877 
FKJY765another@mail.com
FKJY765 

 

Ideally my user login name column would have no blanks and in the case of the first session, include 'some@mail.com' for all incidences, not just the first one. I've tried solving this with a LOOKUPVALUE within the same table and also tried MAXX function, thinking about optimization, but maybe I'm forgetting a simpler workaround.

 

Thanks in advance!

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

the easiest way to fill the table, is to use Fill - Donw in PQ editor,

vxiaotang_0-1627629231431.png

but if you want to use DAX to fill the table, one column is need for sorting. ( you can add index column or date column, as long as it can be used for sorting. )

well, suppose you have added the index column, then

if you want to use New Measure

MeasureTest = CALCULATE(MIN('Table'[UserLoginName]),FILTER(ALLEXCEPT('Table','Table'[SessionID]),'Table'[UserLoginName]<>""))

result

vxiaotang_0-1628071714204.png

OR

if you want to use New Column, 

ColumnTest = CALCULATE(MIN('Table'[UserLoginName]),FILTER(ALLEXCEPT('Table','Table'[SessionID]),'Table'[UserLoginName]<>""))

result

vxiaotang_1-1628071958298.png

 

Any question, please let me know. Looking forward to receiving your reply.

 

 

 

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.

View solution in original post

3 REPLIES 3
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

Have you solved this problem? If yes, could you kindly accept the answer helpful as the solution (or kindly share your solution ). so the others can find it more quickly.

Any question, please let me know.

 

Regards,

Community Support Team _Tang

v-xiaotang
Community Support
Community Support

Hi @Anonymous 

the easiest way to fill the table, is to use Fill - Donw in PQ editor,

vxiaotang_0-1627629231431.png

but if you want to use DAX to fill the table, one column is need for sorting. ( you can add index column or date column, as long as it can be used for sorting. )

well, suppose you have added the index column, then

if you want to use New Measure

MeasureTest = CALCULATE(MIN('Table'[UserLoginName]),FILTER(ALLEXCEPT('Table','Table'[SessionID]),'Table'[UserLoginName]<>""))

result

vxiaotang_0-1628071714204.png

OR

if you want to use New Column, 

ColumnTest = CALCULATE(MIN('Table'[UserLoginName]),FILTER(ALLEXCEPT('Table','Table'[SessionID]),'Table'[UserLoginName]<>""))

result

vxiaotang_1-1628071958298.png

 

Any question, please let me know. Looking forward to receiving your reply.

 

 

 

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.

Anonymous
Not applicable

.

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.