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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Syndicate_Admin
Administrator
Administrator

Optimal values in Power BI

Good morning

I have the following table:

mariases94_2-1662632979693.png

The optimal values are as follows:

mariases94_3-1662633992138.png

The percentages would have to be applied over the "Sales" column.

And they ask me for a bar graph like this:

mariases94_4-1662634066884.png

How can I do this?

Thank you very much and greetings!

4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

@Syndicate_Admin Perhaps try this. Place State column from first table in the X-Axis. Create 2 measures for Y-Axis:

 

Optimo = 
  VAR __State = MAX('Table1'[State])
RETURN
  DIVIDE(
     MAXX(FILTER('Table2',[QMS] = __State),[nueva] +
     MAXX(FILTER('Table2',[QMS] = __State),[recurrente],
     2
  )

Real = 
  VAR __State = MAX('Table1'[State])
  VAR __SalesN = SUMX(FILTER('Table1',[Type]="Nueva"),[Sales])
  VAR __SalesR = SUMX(FILTER('Table1',[Type]="Recurrente"),[Sales])
  VAR __SalesAllN = SUMX(FILTER(ALL('Table1'),[State]=__State &&[Type]="Nueva"),[Sales])
  VAR __SalesAllR = SUMX(FILTER(ALL('Table1'),[State]=__State &&[Type]="Recurrente"),[Sales])
RETURN
  DIVIDE(
     DIVIDE(__SalesN,__SalesAllN,0) + DIVIDE(__SalesR,__SalesAllR,0),
     2
  )

  

 



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Syndicate_Admin

Hello!

But this is with measurements, but I want it with formulas, so this is not a table in Power BI, it is only the data that I have specified for you to take into account. That is, the percentages are not in a table, I just have to apply them in the formula to calculate the percentage:

mariases94_0-1662636615280.png

That is, for example, all the opportunities that the Area has QMS, the Status is Detected and the Type is New, you have to calculate 5% of the Sales column.

And so with all the other categories.

How can I indicate it in DAX?

Thank you very much in advance and greetings!

@Syndicate_Admin OK, yeah, I didn't get that at all from the original post. So how are the Real values calculated versus teh Optimo values? I'm still not sure how the calculation is supposed to work.



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Syndicate_Admin

I explain:

In Power BI I have this table:

mariases94_0-1662637794244.png

And here are the percentages I have to apply (IT's NOT a table or part of the Power BI data model):

mariases94_1-1662637835008.png

The formula would have to be aglo as follows:

Si Type=Nueva && State=Detectado && Area=QMS --> 5% de la columna Sales

Si Type=Nueva && State=Validación && Area=QMS --> 10% de la columna Sales

Si Type=Nueva && State=Evaluación && Area=QMS --> 50% de la columna Sales

And so with the others.

Thank you very much and greetings!

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors