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
Neel98
Frequent Visitor

DAX: Pivot column

Hi,
I need to create the pivoted column in Dax. Here I have attached the sample data. My dataset has a Number, date and value column. The final output will be Number and two date fields. Is this possible in DAX?

Neel98_0-1663253706157.png

 

1 ACCEPTED SOLUTION

@Neel98 

Please try

NewTable =
ADDCOLUMNS (
VALUES ( 'Table'[Number] ),
"5-Sep", CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[Date] = DATE ( 2022, 9, 5 ) ),
"29-Sep", CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[Date] = DATE ( 2022, 9, 29 ) )
)

View solution in original post

3 REPLIES 3
Neel98
Frequent Visitor

Thank you. I am looking for a calculated table. 

@Neel98 

Please try

NewTable =
ADDCOLUMNS (
VALUES ( 'Table'[Number] ),
"5-Sep", CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[Date] = DATE ( 2022, 9, 5 ) ),
"29-Sep", CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[Date] = DATE ( 2022, 9, 29 ) )
)

tamerj1
Super User
Super User

@Neel98 

A matrix visual will do or you're looking for a calculated table?

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.

Top Solution Authors