Forum Discussion

dapling's avatar
dapling
Frequent Visitor
10 years ago
Solved

Reporting Net Sales - Gross less Canx

Ok, so I have c. 750k rows of sales data (and growing).  It's way too much to analyse in Excel using pivots and I've found PBI is the PERFECT solution!   However I still have never managed to figur...
  • MattAllington's avatar
    MattAllington
    10 years ago

    Import the first 3 columns into the data model

    create a lookup table that contains all possible years for your data (sales and Canx) and add to the datamodel 

    join the data[sales year] column to the lookup table year

    join the canx year from the data table to the lookup table year (inactive relationship) 

    add a table to the canvas, and put year from the lookup table on the values

     

    write the the following measures. 

     

    Gross sales = countrows(dataTable)

    total cancelations = calculate(countrows(dataTable),userelationship(lookupTable[year],dataTable[year]))

    net sales = [Gross Sales] - [Total Cancellations]

     

    add the measures you want to the table.