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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
srk_powerbi
Helper II
Helper II

help needed for calculating a measure

hi.

i have a requirement for below table. I have below table and in Power BI report i have slicer for Agent column. 

My requirement is when i select multiple values from slicer (Agent) 

 

Name  Agent(Slicer)   Statecode    State     
abcIE3Red
abcMozilla3Red
abcchrome1Green
abcIos2white
abcedge1green
xyzIE3Red
xyzMozilla3Red
xyzchrome3Red
xyzIos2green
xyzedge2green
bbcIE3Red
bbcMozilla2white
bbcchrome2white
bbcIos2white
bbcedge3Red
    

 

I need to show for each 'Name' value, the Min(Statecode) value

For example1: if Slicer selected values are (IE,Chrome,Mozilla)
Name abc: Corresponding Min(stateInt) for slicer selection is 1 Green
Name ade: corresponding Min(stateInt) for slicer selection is 3 Red
Name bbc:Corresponding Min sateInt for slicer selection is 2 white

Example2:Slicer selected (IE,Mozilla)
Name abc : Corresponding min(StateInt) for the slicer selection is 3 Red
Name ade: corresponding Min(stateInt) for slicer selection is 3 Red
Name bbc: Corresponding Min sateInt for slicer selection is 2 white

 

i also need to show in three diffrent KPI cards one for each StateCode  1, 2, and 3 displaying  count(Name) in three cards

In this example2   Count(Name) for Red = 2

                             Count(Name) for Green = 0

                             Count(Name) for White = 1

 

Help is much appreciated, Thanks

1 ACCEPTED SOLUTION

Hi, @srk_powerbi 

The above picture is before I fix.

I posted again yesterday, but it was without a picture.

Sorry for that.

You can check my yesterday's reply to this post. Or,

please check the below picture and link.

 

Picture10.png

 

https://www.dropbox.com/s/8xpx0dhgq2qvv01/srk_powerbi%202021%200325.pbix?dl=0 

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster.

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

View solution in original post

5 REPLIES 5
srk_powerbi
Helper II
Helper II

HI @Jihwan_Kim   it looks perfect, thanks for solution. But i have minor change to the requirement, so the table has additional records where Statecode has another value '0'.  I still need the same result as before ignoring this 0 value, and return 1 as min,. Can you please help. see the table below.

Name    Agent(Slicer)   Statecode    State    
abcIE3Red
abcMozilla3Red
abcchrome1Green
abcIos2white
abccustom0none
abcedge1green
xyzIE3Red
xyzMozilla3Red
xyzchrome3Red
xyzIos2green
xyzedge2green
xyzcustom0none
bbcIE3Red
bbcMozilla2white
bbcchrome2white
bbcIos2white
bbcedge3Red
bbccustom0none

Hi, @srk_powerbi 

Thank you for your feedback.

Please correct me if I misunderstood your question.

- "custom" is selected together with other agents, ignore 0 value.

- only "custom" is selected, then the result is "none".

Based on my assumption above, I amended measures.

please check the link down below.

 

https://www.dropbox.com/s/8xpx0dhgq2qvv01/srk_powerbi%202021%200325.pbix?dl=0 

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Jihwan_Kim
Super User
Super User

Hi, @srk_powerbi 

Please kindly check the below picture if it is what you needed.

if not, please let me know.

 

Also, sample pbix file link is down below.

inside the pbix file, you can find all measures.

I hope it helps.

 

Picture1.png

 

https://www.dropbox.com/s/8xpx0dhgq2qvv01/srk_powerbi%202021%200325.pbix?dl=0 

 

Did I answer your question? Mark my post as a solution!

Appreciate your Kudos!!

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

hi Jim,

it is correct, but i want the 'custom' value to be shown in th e slicer as well...,in the above pic cutsom value is not shown in slicer

Hi, @srk_powerbi 

The above picture is before I fix.

I posted again yesterday, but it was without a picture.

Sorry for that.

You can check my yesterday's reply to this post. Or,

please check the below picture and link.

 

Picture10.png

 

https://www.dropbox.com/s/8xpx0dhgq2qvv01/srk_powerbi%202021%200325.pbix?dl=0 

 

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster.

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Helpful resources

Announcements
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!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.