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

[DAX formula] Show value of column head where value not empty

Hi,

I am being challenged by a actual simple looking problem, but so far I am not able to solve it. Now I hope, that you can help me:

To create a line graph, in which the sum of reinvestment costs of devices are shown year by year, I need a list of the distinct years, which shall be displayed on the y-axis.
You can see, how the source data look like, here:
devices.PNG

Can you tell me, how the appropriate DAX formula should look like in the column 'year of reinvestments' to receive the year for each row, where a number is contained?

I would be very grateful about some help.

Kind regards.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi

 

  You can get the result in power query editor itself. 

 

 Select the year columns and use "Unpivot Columns" transformation.

 

  Then rename the columns as you like. 

Test1.png

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi

 

  You can get the result in power query editor itself. 

 

 Select the year columns and use "Unpivot Columns" transformation.

 

  Then rename the columns as you like. 

Test1.png

Hi rhariharaneee,

 

thanks for your quick answer. It works great! 🙂

Kind regards

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.