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
ignas
Advocate II
Advocate II

Combining percentage and non percentage values in a matrix

Hello

 

I have some metric values in percentage and other as whole number:

Capture.JPG

Is there any way to display them in the same table?


The problem is that metrics with whole numbers are estimated as Cumulative total, but metrics with percentages as averages.

 

The report file: https://mega.nz/#!vzRG2SbZ!fUsbJcOa7iqsMxXksiiUl70pUSbfuZ3Relvr2q_CtVg

 

Regards,

 

Ignas

 

 

 

7 REPLIES 7
Greg_Deckler
Super User
Super User

I have done this, the trick is to use a SWITCH or IF statement coupled with FORMAT statements.


@ 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...

Hey Greg,

 

Thank you for the answer. Do you have anywhere the example? Or maybe you can do one example in my report?

Basically:

 

Measure =
IF(
     HASONEVALUE('Table'[Metric]), 
     SWITCH(
          MAX('Table'[Metric]),
          "something something %",FORMAT([Measure],"Percent"),
          "something something not %",[Measure]
     ),
     BLANK()
)

@ 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...

Hello @Greg_Deckler


Even though it solved the issue in the table as we format percentages as text, but it does not solve if I want to display newly created variable in graph.

Capture.JPG

A1 will always remain N/A as it is formated as Text. Do you know if there is anything else that could fulfill my needs?

 

Regards,

 

Ignas

 

@ignas- Well, I suppose that you could create a measure to only return a value for A1 and format it as a measure using the Model tab (not using FORMAT) and another measure to only return a value for B1 and format it as a number (don't use FORMAT) and put both of them as Values in your column chart. That might get you there, basically

 

Check if you are working with A1, if so, return something otherwise BLANK. Repeat for B1.

 

It's an odd one, most people don't compare percents to numbers. I have to believe that whatever story you are trying to convey, there's a better way to do it.

 


@ 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...

@Greg_Deckler

 

Thanks alot again.

I tried it also and unfortunately it does not work as it displays the graph axis with either percentage or whole number depending which one is the fist in Column values:

Capture.JPG

 

If you still have any idea you are more than welcome to tell me, because it seems that I tried everything.

Thank you a lot for all of your help

 

Here is a file just in case: https://mega.nz/#!zvITnaqZ!kHJ3BLvl6mADmCFava953pCyWIpKEHvYckPAZwgVw1A

Regards,

 

Ignas

 

 

Hello @Greg_Deckler

 

Thank you a lot. It indeed worked. I appreciate for your help.


Regards,

 

Ignas

 

 

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.