Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
JaySanctuary
New Member

Counting instances across 8 columns of data

Hi all, brand new to PowerBI and managed to get the majority of what I needed created at this point, however I'm now stuck with the mentioned. Each "Check type" has a different set of "deductions" but I'm wanting to display a table where if you were to filter the page to check type m1 for example, it would show a single list of the combined total of the deductions, so in the example below, it would show "M1Deduction6 - 2" and so on.

 

I did read about doing an unpivot but then wouldn't that create each row of data into 8 rows and then scew all other figures?

 

Thanks in advance for any help!

 

AdviserChecktypeOutcomeDeduction type 1Deduction type 2Deduction type 3Deduction type 4Deduction type 5Deduction type 6Deduction type 7Deduction type 8
AdamM1PassM1Deduction 6M1Deduction 10      
DaveR4FailR4Deduction 2       
JohnP2FailP2Deduction 8P2Deduction 6P2Deduction 14P2Deduction 2P2Deduction 23P2Deduction 24P2Deduction 25P2Deduction 26
MikeR2FailR2Deduction 7R2Deduction 15R2Deduction 2     
AdamM2PassM2Deduction 4       
AdamM1PassM1Deduction 10M1Deduction 6M1Deduction 7M1Deduction 8M1Deduction 10   
1 ACCEPTED SOLUTION

Hi @JaySanctuary ,

You can try this:
First in the Power Query:
Select columns Adviser, Checktype and Outcome, Transform > Unpivot Columns > Unpivot Other Columns:

vjunyantmsft_7-1721715336815.png

And the output is as below:

vjunyantmsft_1-1721714453133.png

Click Close & Apply:

vjunyantmsft_2-1721714475904.png

Use this DAX to create a measure:

Count = COUNT('Table (2)'[Value])

Put the column Value and the measure into the table visual, and in Filters on this visual > Value > Advanced filtering > is not empty:

vjunyantmsft_10-1721715454364.png

Then the final output is as below:

vjunyantmsft_4-1721714637027.png

 

Also you mentioned ‘Then I was hoping with a drill down, if I was to click on “M1deduction10” for example, it would show the names of the advisers with this deduction’. But drill down has to have hierarchical results to work (e.g. year, quarter, month, day, etc.), and your data structure doesn't suggest drill down, I suggest you use drill through:
On page2, create another table visual:

vjunyantmsft_9-1721715418097.png

Still on page2, drag the Value field into the drill-through fields:

vjunyantmsft_11-1721715508066.png

Then the final output is as below, right click M1deduction10:

vjunyantmsft_12-1721715549306.png

vjunyantmsft_13-1721715578525.png


Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
JaySanctuary
New Member

Hi @rajendraongole1 , thankyou for the reply!

 

Sorry I may not have explained the expected result the best, I already have a check type filter set up on my dashboard so that part should be fine, but in terms of the table, if I was to filter to "M1", I'd like it to look like the below, with a count of the actual deduction, rather than the collumn header and not split by adviser. Then I was hoping with a drill down, if I was to click on "M1deduction10" for example, it would show the names of the advisers with this deduction.

 

Thanks again

DeductionsCount
M1Deduction 103
M1Deduction 62
M1Deduction 71
M1Deduction 81
  

Hi @JaySanctuary ,

You can try this:
First in the Power Query:
Select columns Adviser, Checktype and Outcome, Transform > Unpivot Columns > Unpivot Other Columns:

vjunyantmsft_7-1721715336815.png

And the output is as below:

vjunyantmsft_1-1721714453133.png

Click Close & Apply:

vjunyantmsft_2-1721714475904.png

Use this DAX to create a measure:

Count = COUNT('Table (2)'[Value])

Put the column Value and the measure into the table visual, and in Filters on this visual > Value > Advanced filtering > is not empty:

vjunyantmsft_10-1721715454364.png

Then the final output is as below:

vjunyantmsft_4-1721714637027.png

 

Also you mentioned ‘Then I was hoping with a drill down, if I was to click on “M1deduction10” for example, it would show the names of the advisers with this deduction’. But drill down has to have hierarchical results to work (e.g. year, quarter, month, day, etc.), and your data structure doesn't suggest drill down, I suggest you use drill through:
On page2, create another table visual:

vjunyantmsft_9-1721715418097.png

Still on page2, drag the Value field into the drill-through fields:

vjunyantmsft_11-1721715508066.png

Then the final output is as below, right click M1deduction10:

vjunyantmsft_12-1721715549306.png

vjunyantmsft_13-1721715578525.png


Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

rajendraongole1
Super User
Super User

Hi @JaySanctuary - you can display a table showing the combined total of deductions for a specific "Checktype" when filtered

 

In query editor, i have performed unpivot other columns by selecting the first two adivser and checktype below is the output.

rajendraongole1_0-1721242234784.png

 

Once unpivot load the changes to desktop and create a measure for total deductions

 

rajendraongole1_1-1721242539021.png

Total Deductions = COUNTROWS('Dedcu')
Hope it work , if not please share the expected result 
 
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.