Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
Hello everyone, I generated a power BI report in matrix visual, based on the expansion i need to display the total count in a card. If my visual contains 6 rows, befire expansion it should show 6 count, if i expanded one row, count should change depends upon the second level hierarchy rows. Like wise i have 3 levels. Main intention is to show the count to users before they export data. if they export data count should tally. Thanks in advance
Solved! Go to Solution.
Assuming I understood correctly, it is not possible to make the number displayed in a card change dynamically based on expanding or collapsing hierarchy levels in a matrix, because expansion does not affect the filter context in DAX.
If you want to display different subtotals based on the expanded level, here are some possible approaches:
Using built-in matrix subtotals – You can use the ISINSCOPE() function to detect the current hierarchy level and display the relevant count accordingly.
Using Field Parameters – You can create multiple measures for different hierarchy levels and let the user select the desired level via a slicer.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
As Ritaf1983 said, here are some details for your reference:
“Table”
Create a measure.
RowCount =
SWITCH(
TRUE(),
ISINSCOPE('Table'[Name]), COUNTROWS(SUMMARIZE(ALL('Table'),'Table'[Name])),
ISINSCOPE('Table'[Cno]), COUNTROWS(SUMMARIZE(ALL('Table'),'Table'[Cno])),
ISINSCOPE('Table'[Lno]), COUNTROWS(SUMMARIZE(ALL('Table'),'Table'[Lno])),
0
)
Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
As Ritaf1983 said, here are some details for your reference:
“Table”
Create a measure.
RowCount =
SWITCH(
TRUE(),
ISINSCOPE('Table'[Name]), COUNTROWS(SUMMARIZE(ALL('Table'),'Table'[Name])),
ISINSCOPE('Table'[Cno]), COUNTROWS(SUMMARIZE(ALL('Table'),'Table'[Cno])),
ISINSCOPE('Table'[Lno]), COUNTROWS(SUMMARIZE(ALL('Table'),'Table'[Lno])),
0
)
Here is the result.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
Hi, Thanks for the response.Here is the sample data.
Lno | Cno | Name |
L1 | ||
C1 | ||
Name1 | ||
C2 | ||
Name2 | ||
L2 | ||
c3 | ||
Name3 | ||
c4 | ||
Name4 |
Conut should show 4 if all the levels I expanded, when i export this data, I will get 4 rows.
Assuming I understood correctly, it is not possible to make the number displayed in a card change dynamically based on expanding or collapsing hierarchy levels in a matrix, because expansion does not affect the filter context in DAX.
If you want to display different subtotals based on the expanded level, here are some possible approaches:
Using built-in matrix subtotals – You can use the ISINSCOPE() function to detect the current hierarchy level and display the relevant count accordingly.
Using Field Parameters – You can create multiple measures for different hierarchy levels and let the user select the desired level via a slicer.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
User | Count |
---|---|
104 | |
69 | |
49 | |
48 | |
47 |