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

Need to sum the Values from one date to another date. the dates are stacked in column.

Hi All , 

It would be grateful if any one can help me with a DAX formula(Measure) for summing the column from one date to another for each line item as the dates are all stacked as headers. i have added the screen shot , so what i need is to sum the ETC hours for the column from 2nd May to 13 june 20. Thanks in advance for your help.

 

AjayRangarajan_0-1597564630355.png

 

1 ACCEPTED SOLUTION
AllisonKennedy
Super User
Super User

Power BI is designed to work in columns, not rows.

So I recommend you click Transform Data from the Home tab and Unpivot the dates. To make this work for future data updates (as the date column headings change), I recommend you select all the NON date columns (in your screenshot this would mean you must select [Level], [ETC Hours], and any of the columns to the left that aren't in your screenshot).
Once you have selected these columns, click the Transform tab from within the Power Query Editor, then select Unpivot Other Columns. You will be left with ETC Hours, Level, Attribute and Value. Rename these if you wish.
Close & Apply your changes.
Then you can put the [Value] column (or whatever you renamed it to) in a visual in the Values and filter by date, level, etc.

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

1 REPLY 1
AllisonKennedy
Super User
Super User

Power BI is designed to work in columns, not rows.

So I recommend you click Transform Data from the Home tab and Unpivot the dates. To make this work for future data updates (as the date column headings change), I recommend you select all the NON date columns (in your screenshot this would mean you must select [Level], [ETC Hours], and any of the columns to the left that aren't in your screenshot).
Once you have selected these columns, click the Transform tab from within the Power Query Editor, then select Unpivot Other Columns. You will be left with ETC Hours, Level, Attribute and Value. Rename these if you wish.
Close & Apply your changes.
Then you can put the [Value] column (or whatever you renamed it to) in a visual in the Values and filter by date, level, etc.

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

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.