Forum Discussion
Group count
Hello,
I have invoice line data for multiple locations with a field that shows if and how much a particular invoice line was discounted; multiple invoice lines are associated with a single invoice number. Not all invoice lines in an invoice have discounts. Invoice number is only unique within locations, so multiple locations can use the same invoice number for different invoices. What I want to do ultimately is create a measure that will count the number of invoice lines in an invoice that have discounts applied (discount amount is greater than 0 or not null) and get a ratio of invoice lines with discount to total invoicelines per invoice. I want to then display this data as an average per invoice per location. Ex:
Location A: Location B:
inv_a 1/10 inv_a 2/3
inv_b 4/8 inv_e 1/12
inv_c 1/4 inv_f 2/8
measure avg per location -- A: 2/7 B: 1/3
I'm not sure how to create this measure, or even where to start really.
Any help would be great.
Anonymous
You may add the following measures.
Measure = DIVIDE ( COUNTROWS ( FILTER ( 'Table', 'Table'[discount] > 0 ) ), COUNTROWS ( 'Table' ) )Measure 2 = AVERAGEX ( VALUES ( 'Table'[Invoice] ), [Measure] )
1 Reply
- v-chuncz-msftCommunity Support
Anonymous
You may add the following measures.
Measure = DIVIDE ( COUNTROWS ( FILTER ( 'Table', 'Table'[discount] > 0 ) ), COUNTROWS ( 'Table' ) )Measure 2 = AVERAGEX ( VALUES ( 'Table'[Invoice] ), [Measure] )