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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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