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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply

Column value depicts which measure is used to generate a percentage

Hi,

I'm back.. again. Sorry, I'm so close to finishing my report though!

 

I want to find out if we're hitting targets.  We have been given percentage targets.

I would love to just use one column to do this on my table visual.

 

I already have measures that give me a target total e.g.

Midlands 22 = SWITCH(SELECTEDVALUE(Data[Programme (Renamed)]),"Midlands",22

South 10 = SWITCH(SELECTEDVALUE(Data[Programme (Renamed)]),"South",10

East 14 = SWITCH(SELECTEDVALUE(Data[Programme (Renamed)]),"East",14

(I use these to plot a line on my graphs)

 

I'm now using the measures above to find out my percentage:

Target Percentage = [Slicer Day Count]*[Midlands 22]
 
What i'm looking for is to be able to use each of these measures dependant on whether another text value is in a column.
 
So if my column is called "Region" contains entries called "Derbyshire" I would like it to use "Midlands 22" in my Target Percentage equation. But, if the region was "Norfolk" it would use "East 14" in my target percentage equation.
 
So I just want one column in my table visual to show an answer dependant on what location is in "Region".  I have a maximum of 5 Locations/regions.
 
I really hope that makes sense!!

Thank you - i've tried lots of variations and i'm not winning.

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @FlankyPank2___ ,

 

 

Create a single measure with the following code:

 

Target = SWITCH(SELECTEDVALUE(Data[Programme (Renamed)]),
                  "Midlands",22
                   "South",10,
                  "East",14)

 

 

Then use the following code:

Target Percentage = [Slicer Day Count]*[Target]

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

3 REPLIES 3
MFelix
Super User
Super User

Hi @FlankyPank2___ ,

 

 

Create a single measure with the following code:

 

Target = SWITCH(SELECTEDVALUE(Data[Programme (Renamed)]),
                  "Midlands",22
                   "South",10,
                  "East",14)

 

 

Then use the following code:

Target Percentage = [Slicer Day Count]*[Target]

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



Thank you so much - simple.

I need to learn Dax when i've finished this project!  Thanks again

Don't forget to accept the correct answer to help others. 


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



Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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