Forum Discussion

Mohitk's avatar
Mohitk
Frequent Visitor
2 years ago

relationship

I have 1 source psr table 1 and it has data till last month and I have 2 table it has this month data both table have same column and 1 different date table but I am facing problem that category I took from psr 1 so it shows old data and if new data is taken then it doesn't show previous month data i want to do relationship with which column i should show sale this month also and previous month also @Ahmedx

4 Replies

  • Mohitk , If you are using date filter, You can create a common date table and use TI intelligence measure for this month and last month

     

    Examples - Changes measure and tables

     

    MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))
    last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))
    last month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth('Date'[Date]))

     

    Based on Date

     

    This Month Today =
    var _min = eomonth(today(),-1)+1
    var _max = eomonth(today(),0)
    return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

    Last Month Today =
    var _min = eomonth(today(),-2)+1
    var _max = eomonth(today(),-1)
    return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

     

     

    Change measures as per need

     

    Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
    Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
    Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

     

     

    Cheat Sheet — Power BI Time Intelligence Formulas Using Today

    https://medium.com/chandakamit/cheat-sheet-power-bi-time-intelligence-formulas-using-today-654f26e27304

  • Mohitk's avatar
    Mohitk
    Frequent Visitor

    because it is old data i need much time to refresh i can save time if i keep updating that excel sheet monthly and i made table psr1 by joining table 2 now i have excel sheet

  • Mohitk's avatar
    Mohitk
    Frequent Visitor

    I want category wise retailing how do I create a new excel sheet  relationship for that and all columns are same then all else will be sale match