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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.