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
Anonymous
Not applicable

Calculate % of orders received from Internet and entered manually per month

Hi,

 

I am quite new to DAX and appreciate some assistance here. I am trying to calculate % of orders entered manually (SDTY = OR) vs. internet orders (SDTYP = EO) per month. looking at the example below there are total 6 orders in April, 4 orders are order type OR and two are EO= 

 

Sales Ord - Created on -SDTY - Order value- Curr.- POtyp - Sold-to
300600292 1/04/2017 YOR 4,225.75 AUD 570039
300600293 1/04/2017 YOR 2,001.68 AUD 570039
300600827 3/04/2017 YEO 814.00 AUD 364651
300600828 3/04/2017 YEO 814.00 AUD 593323
300601580 3/04/2017 YOR 2,051.82 AUD 580064
300601865 3/04/2017 YOR 4,545.19 AUD 551255
300601875 3/04/2017 YOR 951.60 AUD 364647 


Total count = 6 

% of internet order = 2/6 = 33.33%

% of manual orders = 4/6 = 66.66%

 

I tried a few options include countrows etc but no luck, any help is appreciated.

 

regards,

Ifun

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous

 

Try these Measures

 

% Manual orders =
DIVIDE (
    CALCULATE ( COUNTROWS ( TableName ), TableName[SDTY] = "YOR" ),
    COUNTROWS ( TableName )
)
% Internet orders =
DIVIDE (
    CALCULATE ( COUNTROWS ( TableName ), TableName[SDTY] = "YEO" ),
    COUNTROWS ( TableName )
)

 


Regards
Zubair

Please try my custom visuals

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Thank you, it worked live a charm.

Zubair_Muhammad
Community Champion
Community Champion

@Anonymous

 

Try these Measures

 

% Manual orders =
DIVIDE (
    CALCULATE ( COUNTROWS ( TableName ), TableName[SDTY] = "YOR" ),
    COUNTROWS ( TableName )
)
% Internet orders =
DIVIDE (
    CALCULATE ( COUNTROWS ( TableName ), TableName[SDTY] = "YEO" ),
    COUNTROWS ( TableName )
)

 


Regards
Zubair

Please try my custom visuals

@Anonymous

 

Also you can drag the SDTY column to a Table Visual and write one MEASURE

 

%_orders =
DIVIDE ( COUNTROWS ( TableName ), COUNTROWS ( ALL ( TableName ) ) )

2011.png


Regards
Zubair

Please try my custom visuals

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.