Forum Discussion

MRD87's avatar
MRD87
Frequent Visitor
3 years ago

Custom columns in a matrix

I am building a report that requires a resultmatrix for every region

 

I am looking for a solution with the following outcome in mind. 

 

The week and year colomn is pretty easy I made a periode table and linked it to my date table. But this wont give me the outcome that I want since I want to have the growth YoY in the same visual.

 

Is there any way to get this done?

 

3 Replies

  • MRD87 , For YOY Week, you can try measures like

     

    This week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Year]=max('Date'[Year]) && 'Date'[Week] = Max('Date'[Week]) ))
    Last year same week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Year]=max('Date'[Year])-1 && 'Date'[Week] = Max('Date'[Week])))

    diff % = divide([This week] -[Last year same week ] , [Last year same week ])

     

    or

    week Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-364,DAY))

     

    Use a date table


    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

  • MRD87's avatar
    MRD87
    Frequent Visitor

    Thank you for your reply. I wasn't clear in my question. My problem is not in the measures. I got the measures working. My problem is in the structure of the matrix. How can I get those measures in the right colomns.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi MRD87 ,

    You can create a matrix visual and set it as below screenshot:

    If the above one can't help you, could you please provide more raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:

    How to provide sample data in the Power BI Forum

    How to Get Your Question Answered Quickly

    And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

    How to upload PBI in Community

    Best Regards