Forum Discussion
Summarize multiple columns based on values
To unpivot a table using DAX is quite challenging. You may want to try the following steps in DAX to get your desired result.
1. Creating a new table with two columns, 'Rules' and 'Status'
Sorry for confussion, but I need to create a summary table in DAX, because i am pushing to R which is limited to 150,000 rows and my data set is 3 million records and increasing. So, i cant use a widget (like a matrix) to summarize the data.
- v-jiascu-msft7 years agoMicrosoft Employee
Hi Anonymous,
You can get it with the formula below. But this calculated table is relative stable, which means its values can't change as the filters or slicers change.
Table = ADDCOLUMNS ( DISTINCT ( UNION ( VALUES ( Table1[Rule-1] ), VALUES ( Table1[Rule-2] ), VALUES ( Table1[Rule-3] ) ) ), "Rule-1-num", CALCULATE ( COUNT ( Table1[Rule-1] ), FILTER ( 'Table1', 'Table1'[Rule-1] = EARLIER ( 'Table1'[Rule-1] ) ) ), "Rule-2-num", CALCULATE ( COUNT ( Table1[Rule-2] ), FILTER ( 'Table1', 'Table1'[Rule-2] = EARLIER ( [Rule-1] ) ) ), "Rule-3-num", CALCULATE ( COUNT ( Table1[Rule-3] ), FILTER ( 'Table1', 'Table1'[Rule-3] = EARLIER ( Table1[Rule-1] ) ) ) )
Best Regards,
- Anonymous7 years agoNot applicable
I was able to get your solution to work, but as you mentioned when a user filters with a slicer the summary table does not update. This update is a key feature for my solution. Is there no way to create a table in dax that is updateable based on user selections?