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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
sanjaymithran
Helper I
Helper I

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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors