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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
po
Post Prodigy
Post Prodigy

count of median

Hi,

 

Wish to calculate the following

 

 

Percentage of Shops which hit target which varies dynamically depending on w/edate and store name which selected in slicers 

 

Data

 

Shop, W/E date, target met

 

target met is derived in table and can set correctly at table level to 0 depeidning on store percentage above 70, target met is set to 1 

 

e.g

 

A, 05/01/2019,0

A,12/01/2019,0

A,19/01/2019,1

B, 05/01/2019,0

B,12/01/2019,1

B,19/01/2019,1

C, 05/01/2019,1

C,12/01/2019,1

C,19/01/2019,1

 

i.e. in above if looked at all thsi data MEDIA OF A is 0, b is 1 and c is 1 i.e. 66% met target

 

However if were just looking at 19/01/2019 all met target i.e. would be 100%.

 

How can we best achieve this in power bi?

 

Thanks

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

@po,

 

To achieve your requirement, create a measure using DAX formula below:

Met Or Not = 
VAR Percentage = CALCULATE(SUM(Table1[target met]), ALLSELECTED(Table1)) / CALCULATE(COUNT(Table1[target met]), ALLSELECTED(Table1))
RETURN
IF(Percentage >= 0.66, "Met Target", "Not met target")

Capture.PNG  

 

You may also refer to appendix.

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

@po,

 

To achieve your requirement, create a measure using DAX formula below:

Met Or Not = 
VAR Percentage = CALCULATE(SUM(Table1[target met]), ALLSELECTED(Table1)) / CALCULATE(COUNT(Table1[target met]), ALLSELECTED(Table1))
RETURN
IF(Percentage >= 0.66, "Met Target", "Not met target")

Capture.PNG  

 

You may also refer to appendix.

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for reply

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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