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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
MatH
Frequent Visitor

Help! Mental block on how to calculate/visualize my data

Hello,

 

Thanks in advance. I have a table that has reasons for why people have contacted our helpline. 

 

The table includes a 'Lead ID' that is unique to individuals, and then a reason category, sub category and value (True/false)

 

I can currently display this as a list of reasons and a count of true for each one to see how often they're recorded, and filter by it.

 

But people can have more than one. I want to be able to say if for Lead IDs that have value X what other values do they have?

 

I'm having a mental block on how to get this visualisation, as when I filter by subcategory it only shows me that one. I tried some other measures to filter by Lead ID on the subcategory but also didn't have much success.

 

I really appreciate any help overcoming this.

1 ACCEPTED SOLUTION

@MatH Try:

Measure = 
  VAR __LeadID = MAX( 'Table'[Lead ID] )
  VAR __Table = FILTER( ALL('Table'), [Lead ID] = __LeadID )
  VAR __Result = CONCATENATEX( __Table, [Reason Subcategory], ", " )
RETURN
  __Result

Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

@MatH Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler ,

 

My table would look like this just using random topics but the point remains:

 

Lead IDReason CategoryReason SubcategoryTrue/False
1SauceKetchupTrue
1SeasoningSaltTrue
2SauceKetchupTrue
3SeasoningSaltTrue
4SauceMayTrue

 

As you see 'Lead IDs' or people could have more than one row, as they may have more than one category/subcategory. I want to filter to say filter by those who had subcategory Ketchup in this example and see oh they also had salt. If that makes sense?

 

At the moment I'm just able to filter to see the total amount of any individual subcategory. I want to see where they go together, so where people have X subcategory they're likely to have Y as well.

@MatH Try:

Measure = 
  VAR __LeadID = MAX( 'Table'[Lead ID] )
  VAR __Table = FILTER( ALL('Table'), [Lead ID] = __LeadID )
  VAR __Result = CONCATENATEX( __Table, [Reason Subcategory], ", " )
RETURN
  __Result

Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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