cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper II
Helper II

Help with Dividing two categories in a single data column

Capture.JPGPlease see screenshot.  This is a matrix table.  I wish to divide 'engaged' by 'reached'.  However these are categories and all share the same 'value' column.  So how do I do this?  i.e. the logic needs to be division where value=engaged / where value = reached.  Please help! Thanks  

3 ACCEPTED SOLUTIONS

Accepted Solutions
Super User III
Super User III

Hi @mra1984 ,

 

You need to create a measure with the following syntax:

 

% Engaged/reached CALCULATE(SUM(Table1[Value]);Table1[Type] = "Engaged")/ CALCULATE(SUM(Table1[Value]);Table1[Type] = "Reached")

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog:

Power BI em Português





View solution in original post

Thanks, this got me on the right track.  I had to insert apostropes though around table names and also replace your semi colons with commas.  So the correct result was:

ER% = CALCULATE(SUM('Data 2019'[Value]),'Data 2019'[KPI] = "Engaged")/ CALCULATE(SUM('Data 2019'[Value]),'Data 2019'[KPI] = "Reached") 
 

 

View solution in original post

Hi @mra1984 ,

 

You must reduce the size of the columns you want to hide, be carefull to turn off word wrap on columns title and values.

 

This is a workaround but is the way to achieve your goal.

 

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog:

Power BI em Português





View solution in original post

6 REPLIES 6
Super User III
Super User III

Hi @mra1984 ,

 

You need to create a measure with the following syntax:

 

% Engaged/reached CALCULATE(SUM(Table1[Value]);Table1[Type] = "Engaged")/ CALCULATE(SUM(Table1[Value]);Table1[Type] = "Reached")

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog:

Power BI em Português





View solution in original post

Thanks, this got me on the right track.  I had to insert apostropes though around table names and also replace your semi colons with commas.  So the correct result was:

ER% = CALCULATE(SUM('Data 2019'[Value]),'Data 2019'[KPI] = "Engaged")/ CALCULATE(SUM('Data 2019'[Value]),'Data 2019'[KPI] = "Reached") 
 

 

View solution in original post

Hi @mra1984 ,

 

That question about the commas and the names of the tables as to do with the regional settings on the computer it's a normla thing.

 

Glad I could help.

 

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog:

Power BI em Português





Ok understand, sorry about that.  Have remarked as yours.  At least we have both regional solutions now 😉

Also now I have imlemented this, it creates another issue - the measure appears behind every column but I only want it to appear once - how could I adjust this? Capture.JPG

Hi @mra1984 ,

 

You must reduce the size of the columns you want to hide, be carefull to turn off word wrap on columns title and values.

 

This is a workaround but is the way to achieve your goal.

 

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog:

Power BI em Português





View solution in original post

Helpful resources

Announcements
November Update

Check it Out!

Click here to read more about the November 2020 Updates!

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

secondImage

Power Platform October Community Highlights

Check out the top community contributors across all of the communities

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors