Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi All,
I need a help in showing the column headers in such a way that for example if I have data till Jan-2021 and I wanted to show the headers as Jan-2021 and Jan-2020.It should be changed on the data refresh.
Date |
1-jan-2020 |
1-dec-2020 |
1-jan-2021 |
3-jan-2021 |
OutPut:
Jan-2021 | Jan-2020 | |
Sales | ### | ## |
Thanks in advance,
Solved! Go to Solution.
Hi @Anonymous ,
Did you have a date table in your model? You can create a date table and create many to one relationship to fact table.
Dim_Date = ADDCOLUMNS(CALENDAR(DATE(2020,1,1),DATE(2021,12,31)),"month",FORMAT([Date],"mmm")&"-"&YEAR([Date]))
Then use month column as columns in matrix:
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Hi @Anonymous ,
Did you have a date table in your model? You can create a date table and create many to one relationship to fact table.
Dim_Date = ADDCOLUMNS(CALENDAR(DATE(2020,1,1),DATE(2021,12,31)),"month",FORMAT([Date],"mmm")&"-"&YEAR([Date]))
Then use month column as columns in matrix:
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
@Anonymous , one way is use time intelligence and this year vs last year same month, But that will not show month name
example with help from date table
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)))
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
@Anonymous , Assume you have a measure. Try a measure like( use calendar table marked as Date table)
measure =
calculate([meausre] ) + calculate([measure], dateadd('Date'[Date],-1,year))
In this case you should able to use month name as column in matrix
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
105 | |
99 | |
99 | |
38 | |
37 |
User | Count |
---|---|
157 | |
121 | |
73 | |
73 | |
63 |