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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
bslusars
New Member

Issue on filter on Resource capacity analysis

I need to create line graph for Resource Capacity. In my table 'resource' I have Members, Team, %of Capacity, InitialDate and Final date.

 

MemberTeam% of CapacityInitialDateCapacityFinalDateCapacity
JohnTeam A501-1-202412-31-2030
PaulTeam B701-1-202412-31-2030
MarthaTeam A751-1-202412-31-2030

 

I created a calendar table 'TabelaDatas' to create my graphy by month.

 

I could generate the graph with total capacity, applying the measure below 'TotalCapacityHours'

 

TotalCapacityHours =
CALCULATE(
    (160 * SUMX('resource', VALUE('resource'[% of Capacity]))) / 100,
    FILTER(
        ALL('resource'),
        DATEVALUE('resource'[InitialDateCapacity]) <= MAX('TabelaDatas'[Date]) &&
        DATEVALUE('resources'[FinalDateCapacity]) >= MIN('TabelaDatas'[Date])))
bslusars_1-1725538045237.png

 

Now, I cannot add filters by Member and Team, if I add the slicer, it doesn't apply into the graph.

I've already tried to remove the ALL from the measure, and the hole data desapears. 😞

 

Any help to apply the filters?

1 ACCEPTED SOLUTION
v-xuxinyi-msft
Community Support
Community Support

Hi @bslusars 

 

Thanks for the reply from suparnababu8 .

 

@bslusars , I have a few questions to confirm with you. According to this sentence, "I created a calendar table 'TabelaDatas' to create my graphy by month." Is your calendar table just to make the x-axis of the line graph in months? If so, can you consider presenting it in the following form?

vxuxinyimsft_0-1725601522937.png

 

Put InitialDateCapacity in, select the hierarchy, and keep only Month.

 

The reason why there is data for February here is that I added data for February to the sample data you gave.

vxuxinyimsft_1-1725601725806.png

 

And this part of the formula, “(160 * SUMX('resource', VALUE('resource'[% of Capacity]))) / 100”,  is it the sum of each month * 160 and then divided by 100?

 

In my test, I used the InitialDateCapacity column as the x-axis of the chart and Slicer was applied normally.

vxuxinyimsft_2-1725602224887.png

 

Please feel free to correct me if I have any misunderstanding about your requirements. It would be even better if you can provide sample data of the calendar table and your expected results. How to provide sample data in the Power BI Forum - Microsoft Fabric Community Or show them as screenshots or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.

 

Best Regards,
Yulia Xu

 

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
v-xuxinyi-msft
Community Support
Community Support

Hi @bslusars 

 

Thanks for the reply from suparnababu8 .

 

@bslusars , I have a few questions to confirm with you. According to this sentence, "I created a calendar table 'TabelaDatas' to create my graphy by month." Is your calendar table just to make the x-axis of the line graph in months? If so, can you consider presenting it in the following form?

vxuxinyimsft_0-1725601522937.png

 

Put InitialDateCapacity in, select the hierarchy, and keep only Month.

 

The reason why there is data for February here is that I added data for February to the sample data you gave.

vxuxinyimsft_1-1725601725806.png

 

And this part of the formula, “(160 * SUMX('resource', VALUE('resource'[% of Capacity]))) / 100”,  is it the sum of each month * 160 and then divided by 100?

 

In my test, I used the InitialDateCapacity column as the x-axis of the chart and Slicer was applied normally.

vxuxinyimsft_2-1725602224887.png

 

Please feel free to correct me if I have any misunderstanding about your requirements. It would be even better if you can provide sample data of the calendar table and your expected results. How to provide sample data in the Power BI Forum - Microsoft Fabric Community Or show them as screenshots or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.

 

Best Regards,
Yulia Xu

 

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

suparnababu8
Solution Sage
Solution Sage

Hi @bslusars 

 

It sounds like you’re almost there! The issue seems to be with the use of the ALL function, which removes all filters from the ‘resource’ table, making it difficult to apply slicers for Members and Teams. Let’s adjust your measure to respect the slicers.

Try modifying your measure like this:

 

TotalCapacityHours =
CALCULATE(
(160 * SUMX('resource', VALUE('resource'[% of Capacity]))) / 100,
FILTER(
'resource',
DATEVALUE('resource'[InitialDateCapacity]) <= MAX('TabelaDatas'[Date]) &&
DATEVALUE('resource'[FinalDateCapacity]) >= MIN('TabelaDatas'[Date])
)
)

 

By removing the ALL function and directly filtering the ‘resource’ table, the slicers should now work as expected.

Give this a try and let me know if it resolves the issue! 😊

 

If I remove the ALL function, all my data desapears :(. Table and graph returns on blank).

bslusars_0-1725548018521.png

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.