Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hey,
I am new user and I wonder how to write a DAX-code to get the sum (Hours totally) of each column based on periods 202401, 202402, etc... I tried with sum and filter but it didn't work.
Hi,
Thanks fot the solution @Greg_Deckler provided, and i want to offer somre more information for user to refer to.
hello @alissska24 , based on your descriotion, you can refer to the following solution.
Sample data
1.IF you just want to display the total, you can put the data to a matrix visual, it can display the total.
2.You can create a measure
MEASURE =
CALCULATE (
SUM ( 'Table'[Planlagt] ),
ALLSELECTED ( 'Table' ),
'Table'[Period] IN VALUES ( 'Table'[Period] )
)
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you! And how can I make a table at dashboard that will show this when I have data as table and as measuer? And the last row (Resources needed) suppose to be 'divide' function.
Hi @alissska24
Thanks for your quick reply, you can refer to the following solution.
Sample data
1.Create a 1:N relationship between tables
2.Create the following measures
TotalHours = SUM('Table'[Planlagt])
Hour per month = SUM('Table (2)'[Verdi])
Resource needed = SUMX(VALUES('Table (2)'[Period]),DIVIDE([TotalHours],[Hour per month]))
Then put the period field of the table(2) and the measures to the table visual.
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks. It worked very well. I managed to make capacity column as well, but when I add it to the diagram I get only flat line. What is missing?
@alissska24 First, please vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e
This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907
Also: https://youtu.be/uXRriTN0cfY
And: https://youtu.be/n4TYhF2ARe8
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
12 | |
8 | |
8 | |
7 |
User | Count |
---|---|
15 | |
13 | |
9 | |
7 | |
6 |