Forum Discussion
PBIUWO
5 years agoHelper III
How to create dynamic data table to create customized matrix & populating its value?
I have a Sales Data Table that has columns Item Code, Item Description, Sale Month, and Sale Quantity. Item Code Item Description Sales Month Sales Quantity 123-ABC Samp December, 2020 ...
- 5 years ago
Hi PBIUWO ,
First create a date table as below:
calendar table = var _year=IF(MONTH(TODAY())<12,YEAR(TODAY())-1,YEAR(TODAY())) var _month=IF(MONTH(TODAY())<12,MONTH(TODAY())+1,1) Return CALENDAR(DATE(_year,_month,1),TODAY())Then create a column in the calendar table:
Month year = FORMAT('calendar table'[Date],"MMMM")&" "&YEAR('calendar table'[Date])And a measure as below:
Measure = var _tab=SUMMARIZE('Table','Table'[Item Code],'calendar table'[Month year],"sumofsales",SUM('Table'[Sales Quantity])) return SUMX(_tab,[sumofsales])+0Finally,you will see:
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
smpa01
5 years agoCommunity Champion
PBIUWOcan you try this - https://drive.google.com/file/d/1VeeUWzJIOmqaAlb9p7fgn0DnOGFABQED/view?usp=sharing
- PBIUWO5 years agoHelper III
I don't have access to this