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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Girish_123
Helper I
Helper I

want to show selected year data as well as previous year data value in a table

I have table (Input Table)
Year     Value
2023    AA
2022    BB
2021    CC
2020    DD
2019    EE

i want a output in table visual, lets say if i select 2023 from slicer so in a table it show like slicer - 2023
Year    value 
2023    AA
2022    BB

1 ACCEPTED SOLUTION
v-xinruzhu-msft
Community Support
Community Support

Hi @Girish_123 

You can refer to the followng example

1.Create a calculated table and put the field to the slicer

Table 2 = SUMMARIZE('Table',[Year])

vxinruzhumsft_0-1682302179816.png

 

2.Create a measure, and put the measure to the table visual

Measure = IF(ISFILTERED('Table 2'[Year]),CALCULATE(MAX('Table'[Value]),FILTER('Table',OR('Table'[Year]=SELECTEDVALUE('Table 2'[Year]),'Table'[Year]=SELECTEDVALUE('Table 2'[Year])-1))),MAX('Table'[Value]))

Output

vxinruzhumsft_1-1682302249690.png

Best Regards!

Yolo Zhu

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

1 REPLY 1
v-xinruzhu-msft
Community Support
Community Support

Hi @Girish_123 

You can refer to the followng example

1.Create a calculated table and put the field to the slicer

Table 2 = SUMMARIZE('Table',[Year])

vxinruzhumsft_0-1682302179816.png

 

2.Create a measure, and put the measure to the table visual

Measure = IF(ISFILTERED('Table 2'[Year]),CALCULATE(MAX('Table'[Value]),FILTER('Table',OR('Table'[Year]=SELECTEDVALUE('Table 2'[Year]),'Table'[Year]=SELECTEDVALUE('Table 2'[Year])-1))),MAX('Table'[Value]))

Output

vxinruzhumsft_1-1682302249690.png

Best Regards!

Yolo Zhu

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

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.