Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have a dimension that stores workflows(cases, subcases). I would like to do a count of how many subcases are created for each case.
Workflow Dimension
Workflow ------------------------------ Case Number WorkflowType ------------------------------ 10 Case 20 Case 30 Case 20-1 Subcase 20-2 Subcase 20-3 Subcase 10-1 Subcase
The desire output I would like is, for every case count how many subcases were created.
Workflow ------------------------------------------------ Case Number WorkflowType CountOfSubcases ------------------------------------------------ 10 Case 1 20 Case 3 30 Case 0 ------------------------------------------------ Total 4
I have a current dax measure that works, but the total at the bottom does not show when looking at multiple rows, only display when one case is selected.
Total Subcases = VAR CC = FIRSTNONBLANK ( Workflow[Case Number], 1 ) RETURN COUNTX ( FILTER ( ALL( Workflow ), SUBSTITUTE ( Workflow[Case Number], RIGHT ( Workflow[Case Number], 2 ), "" ) = CC && Workflow[WorkflowType] = "SubCase" ), Workflow[WorkflowID] )
If anybody could help me tweak my measure or present with a new measure, that would be great.
Thanks in advance.
Solved! Go to Solution.
Hi sqlwiz,
First create a calculate column:
New_Column = SUBSTITUTE ( Workflow[Case Number], RIGHT ( Workflow[Case Number], 2 ), "" )
Then create a measure using DAX below:
Total Subcases = CALCULATE ( COUNT ( Workflow[Case Number] ), FILTER ( ALLEXCEPT ( Workflow, Workflow[New_Column] ), Workflow[WorkflowType] = "SubCase" ) )
Regards,
Jimmy Tao
Hi sqlwiz,
First create a calculate column:
New_Column = SUBSTITUTE ( Workflow[Case Number], RIGHT ( Workflow[Case Number], 2 ), "" )
Then create a measure using DAX below:
Total Subcases = CALCULATE ( COUNT ( Workflow[Case Number] ), FILTER ( ALLEXCEPT ( Workflow, Workflow[New_Column] ), Workflow[WorkflowType] = "SubCase" ) )
Regards,
Jimmy Tao
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
69 | |
68 | |
40 | |
29 | |
26 |
User | Count |
---|---|
88 | |
49 | |
45 | |
38 | |
37 |