Forum Discussion
Counting column values for a matrix visual
- 3 years ago
Hi pg9 ,
Please try:
Measure = CALCULATE(COUNT(Sheet1[EmpIID]),FILTER(ALL(Sheet1),[Attribute] in ALLSELECTED('Sheet1 (2)'[Attribute]) &&[Value] in ALLSELECTED('Sheet1 (2)'[Value])))Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi pg9 ,
By calculating it separately do you mean making its value independent of slicer and calculating the value in the table directly? If so, you can use the ALL function, like this:
Measure = COUNTX(All('Table'[EmpID]'),[EmpID])
Refer to:
ALL function (DAX) - DAX | Microsoft Learn
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I tried that DAX and it does not filter when I apply filter conditions. Please find the image below
The requirement is for the Total count to change as and when we apply filter conditions. Can you help me with this please?
- v-jianboli-msft3 years agoCommunity Support
Hi pg9 ,
Apologies for my misunderstood before. Are you trying to calculate the "Total number of EmpID" while disregarding the impact of the "Field Selection" slicer, but allowing it to be influenced by the "Criteria Selection" slicer?
If so, there are some information I need to check:
If the slicer: "Field Selection" and "Category" are using the same data?
Please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.
Refer to:
How to provide sample data in the Power BI Forum
How to Get Your Question Answered Quickly
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- pg93 years agoFrequent Visitor
No problem. Yes, you are right. I'm trying to calculate the "Total number of EmpID" while disregarding the impact of the "Field Selection" slicer, but allowing it to be influenced by the "Criteria Selection" slicer.
FYI, The 'Field selection' and the Matrix visual uses Sheet 1 table and 'Criteria selection' uses Sheet 1(2) table.
The count should be static for the 'Field selection' but should change accoring to the filters applied in the 'Criteria selection' slicer.
P:S - I'm unable to share this pbix file with you since I'm not a super user ☹️
- v-jianboli-msft3 years agoCommunity Support
Hi pg9 ,
Please try:
Measure = CALCULATE(COUNT(Sheet1[EmpIID]),FILTER(ALL(Sheet1),[Attribute] in ALLSELECTED('Sheet1 (2)'[Attribute]) &&[Value] in ALLSELECTED('Sheet1 (2)'[Value])))Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.