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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.