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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

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
v-kongfanf-msft
Community Support
Community Support

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
v-kongfanf-msft
Community Support
Community Support

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
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors