Forum Discussion

ATMAN777's avatar
ATMAN777
New Member
1 year ago
Solved

Using a baseline perspective

Hi PowerBI gurus,   Given a dataset example below, I'd like to display total sale quantity by date in a line graph. This I can easily do. I'd like to be able to use a baseline line (the start from ...
  • Selva-Salimi's avatar
    1 year ago

    Hi ATMAN777 

    Thanks for updating the post. here is the solution:

    you can write a measure as follows:

    sales_by_baseline =
    var baseline = min(DimDate[date])
    var fruits = summarize(filter(all(Table_sales) , Table_sales[Date] = baseline) , Table_sales[Fruit])
    RETURN
    calculate(sum(Table_sales[Sale Quantity]) , filter (Table_sales,  Table_sales[Fruit] in fruits && Table_sales[Date] >= baseline ))
     
    kepp in mind that X-axis of line chart should be selected from sales_table and the slicer should be selected from DimDate . and also there should NOT be any relation between your sales_table and dimdate
     
    If this post helps, then I would appreciate a thumbs up  and mark it as the solution to help the other members find it more quickly.