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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mra1984
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
MFelix
Super User
Super User

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
MFelix
Super User
Super User

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



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") 
 

 

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



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



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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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