Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Matrix report

I would need to display the data in the below Matrix format,the final data should be like as below. Please suggest the best visualization of this and changing the headers based dates.

Formulas 

2018CasesPrevious Year Cases formula (calculate (cases, filter(year = Previous year) 
2018SalesPrevious Year Sales formula ( same as above)
2019CasesCurrent Year cases formula
2019SalesCurrent Year sales formula

 

appreciate if any thoughts around this

 

    2018 ( this year should be changed based on Field value )2019 ( year should dynamically change based on field)
Customer NameAddressZipCodeDistributorCases(Month Wise from Jan to dec)Sales(Month wise from Jan to Dec)Cases(Month Wise from Jan to dec)Sales(Month wise from Jan to Dec)
        
        
        
        

 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

Could you tell me if your problem has been solved? If it is, kindly mark the helpful answer as a solution if you feel that makes sense. Welcome to share your own solution. More people will benefit from the thread.

 

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

Not Clear but you should be able to do it using year behind measure or dates ytd total ytd

 

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(('Date'[Date]),"12/31"))
This Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD((ENDOFYEAR('Date'[Date])),"12/31"))

Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
Last YTD complete Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))
Last to last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-2,Year),"12/31"))

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

 and date table

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

 

Anonymous
Not applicable

  Naveen.png

 

Hi @Anonymous ,

As your image shown, I think the matrix visual should work. You can lay them out like below.

MatrixMatrix

SlicerSlicer

And you could click the slicer to change the header of year in Matrix. I'm not clear what you mean that change it dynamically based on field.

You could download my sample to check if it is what you want. If it is not, please share more details to us. We will understand clearly.

 

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @Anonymous ,

Could you tell me if your problem has been solved? If it is, kindly mark the helpful answer as a solution if you feel that makes sense. Welcome to share your own solution. More people will benefit from the thread.

 

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

This is not resolved. I wanted to display data in Matrix report. Let me make myself clear on this.

When you select Year /Month . The data displaying Month wise and Year Totals at the end of each row.

 

But,I wanted to show the 2018 Months and  2019 Months ,and then 2018 Year totals/2019 Year totals side by side at the end.

 

also, wanted to show Grand totals at the top instead of  bottom.

 

Hi @Anonymous ,

 

Not sure what you mean by "month wise" in your expected output example. Do you mean you want January on row 1, then Feb on row 2 etc.?

 



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.