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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
sanjaymithran
Helper II
Helper II

Matrix table show current year and Previous year value and month year as column

Hi All,

 

I have the requirement to show current year and Previous year value in Matrix based on slicer month year selection month will display in coulumn cust1,cust2 and others are current year calc same calc for previous year and show under this table cust1 PY,Cust2 PY and others PY,If add the measure cust1 PY etc its show jan 23 to mar 23 values on column but i want column should be jan feb mar and corresponding values for cust1 and cust1 PY

sanjaymithran_0-1720505873125.png

Thanks,

Sanjay.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @sanjaymithran ,

 

Depend on your description, you can try formula like below:

Cust1 CY = 
CALCULATE(
    SUM(Sales[Amount]),
    FILTER(Sales, Sales[Customer] = "Cust1")
)
Cust2 CY = 
CALCULATE(
    SUM(Sales[Amount]),
    FILTER(Sales, Sales[Customer] = "Cust2")
)
Cust1 PY = CALCULATE([Cust1 CY],SAMEPERIODLASTYEAR('Date'[Date]))
Cust2 PY = CALCULATE([Cust2 CY],SAMEPERIODLASTYEAR('Date'[Date]))

 

vkongfanfmsft_0-1721898009596.png

Best Regards,
Adamk Kong

 

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

2 REPLIES 2
Anonymous
Not applicable

Hi @sanjaymithran ,

 

Depend on your description, you can try formula like below:

Cust1 CY = 
CALCULATE(
    SUM(Sales[Amount]),
    FILTER(Sales, Sales[Customer] = "Cust1")
)
Cust2 CY = 
CALCULATE(
    SUM(Sales[Amount]),
    FILTER(Sales, Sales[Customer] = "Cust2")
)
Cust1 PY = CALCULATE([Cust1 CY],SAMEPERIODLASTYEAR('Date'[Date]))
Cust2 PY = CALCULATE([Cust2 CY],SAMEPERIODLASTYEAR('Date'[Date]))

 

vkongfanfmsft_0-1721898009596.png

Best Regards,
Adamk Kong

 

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

cath1ynn
Resolver II
Resolver II

Can you please provide a sample PBIX file or sample data file?

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.