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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Puja
Helper III
Helper III

Need help with DAX

Hello All,

Please, I need some help with DAX (not in PQ)

I have a table below

DATE        TypeA   TypeB
1/16/2021  A           B
1/30/2021  A           B
2/13/2021  A           B
2/27/2021  A           B
3/20/2021  A           B

 

Is there a way I can get a format like this using DAX?

1/30/2021A

DATETYPE

1/16/2021

A
2/13/2021A
2/27/2021A
3/20/2021A

1/16/2021

B
1/30/2021B
2/13/2021B
2/27/2021B
3/20/2021B

 

Thank you

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @Puja 

try like:

Table =
UNION
(
    SELECTCOLUMN(
       TableName,
       "Date", TableName[Date],
       "A", TableName[A]
    ),
    SELECTCOLUMN(
       TableName,
       "Date", TableName[Date],
       "B", TableName[B]
    )
)

View solution in original post

6 REPLIES 6
tamerj1
Super User
Super User

Hi @Puja 

how many types do you have? Any columns other than date and type are required?

Hi @tamerj1 ,

Yes, I do have other columns like Month and Year.

Also, I want the reqested format in the same table.

 

TIA

@Puja 

Would you please update the provided sample perhaps with more realistic data?

Hi @tamerj1 ,

Below solution helped. Thank you for looking into it.

FreemanZ
Super User
Super User

hi @Puja 

try like:

Table =
UNION
(
    SELECTCOLUMN(
       TableName,
       "Date", TableName[Date],
       "A", TableName[A]
    ),
    SELECTCOLUMN(
       TableName,
       "Date", TableName[Date],
       "B", TableName[B]
    )
)

Thank you @FreemanZ  🙂

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors