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
st-dat
Helper III
Helper III

Measure to calculate percentage of Low spend

 

Hello Team,

 

Kindly help solve this issue explained below:

 

I have used below measure and others but could not get expected result…….

% Low Invoice = CALCULATE(DISTINCTCOUNT(Table1[Invoice]), FILTER(Table1, Table1[Net Sales]>15 && Table1[Net Sales]<40))

 

 

What is the percentage of invoice greater 15 pounds and less than 30 pounds?
        
Invoice Item TypePounds     
787878105.00     
7878781005.00     
78787855.00     
787878305.00     
5555665010.00     
5555667020.00     
555566520.00     
555566520.00     
4444992010.00     
4444991020.00     
44449920020.00     
6666341505.00     
6666343010.00     
6666341010.00     
8882223050.00     
8882222010.00     
        
SOLUTION:       
Total Invoice = DistinctCount of Invoice = 4    
Range to consider - >15 and <30     
787878 Invoice = 20 pounds within range    
555555 invoice = 70 pounds within range    
444499 Invoice = 50 pounds exceeds specified range   
666634 Invoice = 25 pounds exceeds specified range   
666634 Invoice = 60 pounds exceeds specified range   
Two invoices within the range and Three exceeed the range = 2/5*100 = 40% 

 

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

Try this measure

 

=COUNTROWS(FILTER(SUMMARIZE(VALUES(Data[Invoice]),[Invoice],"ABCD",SUM(Data[Pounds])),[ABCD]>=15&&[ABCD]<=30))/DISTINCTCOUNT(Data[Invoice])

 

Hope this helps.

 

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi st-dat,
See images I've attached.
Tell us if works for you.

 

PBI Comunity-1.pngPBI Comunity-2.pngPBI Comunity-3.pngPBI Comunity-4.png

Hi,

 

Thank you so much, It works for general purpose and yet for my specific need. I will appreciate a measure that returns a single value for week and previous week sales.

 

Regards

 

St-dat

Ashish_Mathur
Super User
Super User

Hi,

 

Try this measure

 

=COUNTROWS(FILTER(SUMMARIZE(VALUES(Data[Invoice]),[Invoice],"ABCD",SUM(Data[Pounds])),[ABCD]>=15&&[ABCD]<=30))/DISTINCTCOUNT(Data[Invoice])

 

Hope this helps.

 

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi, Thank you, I will be able to test and provide feedback on Monday.

 

Just to confirm again, what is rquire to do are: (1) find distinct count value of invoice with

cummulative total between 15 and 30 pounds divide by (2) distinct count of all the invoices.

 

I trust your judgement always, I have one more request posted.

Best regards

Hi  @st-dat

 

Do you have any other problems? If not, please accept the helpful reply as solution, that way, other community members will easily find the solution when they get same issue.

 

Regards,

Cherie

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

Hi Cherie,

 

I just did, thanks

 

Regards

 

St-dat

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.