Forum Discussion

Sadr_Hoda's avatar
Sadr_Hoda
Frequent Visitor
3 years ago

Unable to use grouping

Hi, I have a date column in multiple table and link as below. It is working fine. 

 

However, if I want to prepare a report on PL_Structure (Reporting) column month wise, except for current year, prior year value is coming under December month. 

Please advise.

1 Reply

  • Sadr_Hoda , Not very clear?

     You can use measures like

     

    MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD('Date'[Date]))


    last year MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-12,MONTH)))
    Previous year Month Sales = CALCULATE(SUM(Sales[Sales Amount]),previousmonth(dateadd('Date'[Date],-11,MONTH)))

     

    This Month = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Year]=max('Date'[Year]) && Date[Month]=max(Date[Month])))
    last Month only This year = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Year]=max('Date'[Year]) -1 && Date[Month]=max(Date[Month]) ))

     

    Power BI — Month on Month with or Without Time Intelligence
    https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
    https://www.youtube.com/watch?v=6LUBbvcxtKA

     

    The information you have provided is not making the problem clear to me. Can you please explain with an example.

    Appreciate your Kudos.