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
o59393
Post Prodigy
Post Prodigy

If selected filter on slicer then assign target

Hi all

 

I have a slicer containing 9 different categories.

 

My intentntion is to have a measure that shows up the target (of the table shown in the image below) depending on the category selected above.


For example if i select "CSD Regular" for the KPI global then I should get a 100%, and if I select "Hot Fill" for same KPI global then I should get a 95%

 

The expected result is shown in blue next to each KPI:

sadsadasdsadsasd.JPG

 

The targets are in the lower right corner.

 

I often get confused with SelectedValue, hasonvalue, hasonfilter and the function switch. One of these might be required I guess.

 

I attach PBix

 

https://1drv.ms/u/s!ApgeWwGTKtFdhmc6hMVmmqyeKKwZ?e=jjSokR

 

Thanks all.

 

 

3 REPLIES 3
V-pazhen-msft
Community Support
Community Support

@o59393 

This pbix has way many columns and measure included, it is way too complex for us to track the measures within measures, can you create a sample pbix that illustrates your problem in a neat way and post back. Thank you.

 


Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
  

Hi @V-pazhen-msft 

 

I did an excel with what Im looking for, the only way I could think of it to solve it was with vlookups.

 

Cell B1 is a dropdwon menu and green cells are the expected result:

 

https://1drv.ms/x/s!ApgeWwGTKtFdhmmvO41AZwAVZ82x?e=oK3rHV

 

I re arranged the sheet of the pbix. The expected result (green cells in the excel) should go here were the blue arrow points:

 

expected.JPG

PBI: https://1drv.ms/u/s!ApgeWwGTKtFdhmc6hMVmmqyeKKwZ?e=PADVuO

 

All I want is to have the target value from the table depending on the category you select in the slicer.

 

Let me know if it's ok the example.

 

Thanks!

 

Hi @V-pazhen-msft 

 

I created 3 measures and they worked:

 

 

 

global tgt = 

var _GlobalTarget = SELECTEDVALUE(QID[Categories])
return
CALCULATE(AVERAGE(QID[Global QID]),
FILTER(QID,QID[Categories]=_GlobalTarget))

 

 

 

cpk tgt = 

var _CPKTarget = SELECTEDVALUE(QID[Categories])
return
CALCULATE(AVERAGE(QID[CPK QID]),
FILTER(QID,QID[Categories]=_CPKTarget))

 

 

 

complaints tgt = 

var _CCPMTarget = SELECTEDVALUE(QID[Categories])
return
CALCULATE(AVERAGE(QID[Complaints QID]),
FILTER(QID,QID[Categories]=_CCPMTarget))

 

 

sadasdads.JPG

 

If you know an optimized dax measure of the above, please let me know 😄

 

Thanks!

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.