cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
ManuSacchetti
Helper I
Helper I

Show text in a matrix based on a filter

Hello

I'm trying to build a matrix with some information in it. Now I'm stucked in a text filter. I need the matrix to show me differents values depending on the expansion of the first column (Name):

 

General view:

ManuSacchetti_1-1663677391689.png

 

Name expanded:

ManuSacchetti_2-1663677422029.png

 

So I need the matrix to show me in the general view, the actions commited that have the max percentage in the Total Percentage (in this case is 1/1). The column Actions Commited has string values.

This is the Dax Measure that I'm using right now:

 

Actions Committed =
IF(ISFILTERED('Table1'[Name]),IF(ISFILTERED('Table1'[Incidents]),MAX('Table1'[Actions Commited]),MAX('Table1'[Actions Commited])))

 

I think that the bold part of the dax measure is wrong. Can you help me to figure this out please?

 

 

1 ACCEPTED SOLUTION

@ManuSacchetti So maybe this?

Actions Committed MM3TR&R = 
  IF(
    ISINSCOPE('Table1'[Incidents]),
    [Actions Committed],
      VAR __Table = SUMMARIZE('Table1',[Name],[Incidents],"AC",[Actions Committed],"Per",[Total Percentage])
      VAR __Max = MAXX(__Table,[Per])
    RETURN
      MAXX(FILTER(__Table,[Per] = __Max),[AC])
  )

@ 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

7 REPLIES 7
ManuSacchetti
Helper I
Helper I

@Greg_Deckler no! the second screenshot is ok. The problem is in the first screenshot with the column "Actions Commited" because it has to show the string "1/1" because is the string that has the maximum percentage of the column "Total Percentage" (you can see this in the second screenshot).

Here you have another example:

 

General view:

ManuSacchetti_0-1663680446627.png

Expanded view:

ManuSacchetti_1-1663680503826.png

 

@ManuSacchetti So maybe this?

Actions Committed MM3TR&R = 
  IF(
    ISINSCOPE('Table1'[Incidents]),
    [Actions Committed],
      VAR __Table = SUMMARIZE('Table1',[Name],[Incidents],"AC",[Actions Committed],"Per",[Total Percentage])
      VAR __Max = MAXX(__Table,[Per])
    RETURN
      MAXX(FILTER(__Table,[Per] = __Max),[AC])
  )

@ 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler you are a genius!!! it worked! thank you for your patience!!!

@ManuSacchetti Woot!


@ 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
ManuSacchetti
Helper I
Helper I

@Greg_Deckler i dont have problems with the position I'm in the matrix. I'm having problems with the value I want to show in the matrix in the general view

@ManuSacchetti So in the second screenshot you only want the Consume alimentos row to show?? If that is the case, you could potentially solve that by doing an SUMMARIZE over ALL where you summarize by your matrix hierarchy elements and include your measure as part of the summarization. Then you would grab the max value from that and compare with your row value and if they are the same, return the % and if not return BLANK. Hard to be super specific without sample data and a clear explanation of what you are trying to achieve.

 


@ 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Super User
Super User

@ManuSacchetti Use ISINSCOPE to determine where you are in the matrix and return values accordingly.


@ 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors