Forum Discussion
Different Calc for not IsInScope - Help
I have a matrix visual working how I want for row total to calculate something different than the sum of the rows for each year but in the total column on the total row I want the average of the numbers to the left - not the count of the rows.
See below - I want to replace the x with the average of 1,1,4,4,4, and 2 but nomatter what I do I can only get 5 which is the count of all the projects. Any pointers woudl be appreciated!
nicer formatting
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.
Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
10 Replies
- lbendlinSuper User
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.
Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523 - Shahid12523Community Champion
LifeCycleByCountOfMonths =
VAR _tab =
SUMMARIZECOLUMNS(
dimProject[ProjectName],
dimCal[Period],
"LCatTime", [LifeCycleByDate]
)
VAR _selLifeCycle = SELECTEDVALUE('stbl-LifeAbrv'[LifeAbv])
VAR _countSelected =
COUNTROWS(
FILTER(_tab, [LCatTime] = _selLifeCycle)
)
VAR _prjs =
COUNTX(
SUMMARIZECOLUMNS(dimProject[ProjectName], FILTER(_tab, [LCatTime] = _selLifeCycle)),
1
)
VAR _aveProj =
AVERAGEX(
VALUES(dimProject[ProjectName]),
CALCULATE(
COUNTROWS(
FILTER(_tab, [LCatTime] = _selLifeCycle)
)
)
)
RETURN
SWITCH(
TRUE(),
NOT(ISINSCOPE(dimProject[ProjectName])) &&
NOT(ISINSCOPE(dimCal[Year])) &&
NOT(ISINSCOPE(dimCal[Month])), _aveProj,
NOT(ISINSCOPE(dimProject[ProjectName])), _prjs,
_countSelected
) - v-ssriganeshCommunity Support
Hello mgrayTCB,
We hope you're doing well. Could you let us know if your issue has been resolved? If you are still experiencing any problems, please share sample data so we can reproduce the scenario and provide a solution.
Thank you.
- mgrayTCBHelper IV
I still cant get it to work. All I can get is the total count when what I want is the average of the count for each year.
Unfortunatly I dont have an easy way to share the data.- lbendlinSuper User
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.
Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
- v-ssriganeshCommunity Support
Hi mgrayTCB,
To assist you further, could you please provide sample data that clearly illustrates the issue you're experiencing?- Include a small dataset that fully captures the issue (preferably in table format or as a downloadable file, not just a screenshot).
- Avoid including any sensitive or unrelated information.
- Also share the expected outcome based on the sample data you provide.
Need help preparing or uploading sample data? You can refer to this helpful guide:
How to provide sample data in the Power BI Forum - Microsoft Fabric CommunityThis will help us reproduce your scenario accurately and provide a precise solution.
Best regards,
Ganesh Singamshetty.- v-ssriganeshCommunity Support
Hello mgrayTCB,
I am following up to see if you had a chance to review my previous response and provide the requested information. This will enable us to assist you further.
Thank you.
- mgrayTCBHelper IV
I took a break from trying to solve that problem. ill look at it with fresh eyes next week hopefully