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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Help calculating the percentage of a total value in a week number opposed to total of other value

This is a complicated situation for this calculation, but please help me make this.

There are week numbers. In every week there are made hours that consist both of direct hours (directe uren) and indirect hours (indirecte uren). 

For every week number (week nummer), I already was able to show the total hours made in that week number in that year (jaar).

 

I still need to calculate the percentage of the total indirect hours in that week opposed to the total hours (indirect+direct) of that week.

This might not be possible to show in a colomn since it's different per week number but I want to at least show it in a table in the visuals.

Here is a better view of the current situation(blurred for privacy):

tempsnip.png

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

If you want to get sum of each Year and each Week, just modify @amitchandak 's method like:

Column=sumx(filter( table,[Year]=earlier('Table'[Year])&& [Week Number] = earlier('Table'[Week Number])), Table[Value])
Measure=sumx(filter(allselected( table),[Year]=MAX('Table'[Year]) && [Week Number] = Max('Table'[Week Number])), Table[Value])

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

 

If you want to get sum of each Year and each Week, just modify @amitchandak 's method like:

Column=sumx(filter( table,[Year]=earlier('Table'[Year])&& [Week Number] = earlier('Table'[Week Number])), Table[Value])
Measure=sumx(filter(allselected( table),[Year]=MAX('Table'[Year]) && [Week Number] = Max('Table'[Week Number])), Table[Value])

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , if you need a column your denominator will be

 

Example

sumx(filter( table, Table[Week Number] = earlier([Week Number]) ) , Table[Value])

 

oa measure

sumx(filter(allselected( table), Table[Week Number] = Max([Week Number]) ) , Table[Value])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi Amitchandak,

I think this example shows a new column containing the total value for each week number.

The problem is that I have more than one year and both are using the same weeknumbers. So this total per week number is for all years. Any solution to this?

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.