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
Elakiya
Regular Visitor

How to find MAT(Moving Annual Total) where Months are separate column.

I am new to POWER Bi. i want to calculate the MAT(Moving Annual Total) . I got result using below calculation in Table Fotmat.

MAT (moving annual total) = CALCULATE(
SUM(toal),
DATESINPERIOD(date_field,LASTDATE(date_field),-1,YEAR)
)

 

 

 

i got exact answer in above formati got exact answer in above format

But  i want result in below.using the above calculation i got wrong answer in matrix format. Please any one help me to get right answer in below formatExpected output formatExpected output format

1 ACCEPTED SOLUTION
v-huizhn-msft
Employee
Employee

Hi @Elakiya,

Please create a calculated column using the formula.

Month =
SWITCH (
MONTH[Date],
1, "January",
2, "February",
3, "March",
4, "April",
5, "May",
6, "June",
7, "July",
8, "August",
9, "September",
10, "October",
11, "November",
12, "December",
"Unknown month number"
)


Then create a matrix visual, put [Month] as Column level(highlighted in yellow) as follows, product as Row level, other measure as value level, you will get expected result.

1.PNG

Best Regards,
Angelia

View solution in original post

1 REPLY 1
v-huizhn-msft
Employee
Employee

Hi @Elakiya,

Please create a calculated column using the formula.

Month =
SWITCH (
MONTH[Date],
1, "January",
2, "February",
3, "March",
4, "April",
5, "May",
6, "June",
7, "July",
8, "August",
9, "September",
10, "October",
11, "November",
12, "December",
"Unknown month number"
)


Then create a matrix visual, put [Month] as Column level(highlighted in yellow) as follows, product as Row level, other measure as value level, you will get expected result.

1.PNG

Best Regards,
Angelia

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.