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
sverderame
Helper I
Helper I

Obtaining a row value when using "Less than or equal too slicer (Year)

Obtaining a single row value when using "Less than or equal too slicer (Year)

 

I have a table that has 32 rows oy yearly values (year 2000 - 2032), each row has a widget value for its associated year. I am using a few kpi visuals that are working great with this slicer. 

 

Using the CARD visual.

 

When I move the slider to the year 2015 (essentially 2000 - 2015) the value returned on the CARD is the summation of each row value from 2000 - 2015, which is logical. 

 

What I'd like to know is... Is there a way to return the value of the max year of the slider slicer. example from above is that I would like to just return the value of the year 2015 in the CARD.

 

Thank you.

2 ACCEPTED SOLUTIONS
Jihwan_Kim
Super User
Super User

Hi,

I do not know how your data model looks like, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

I hope the below can provide some ideas on how to create a solution for your data model.

Jihwan_Kim_0-1672541261414.png

 

Jihwan_Kim_1-1672541397133.png

 

 

Value maxyear measure: =
CALCULATE ( [Value total measure:], 'Year'[Year] = MAX ( 'Year'[Year] ) )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

Hi,

Thank you for your message, and please check the below picture and the attached pbix file.

Jihwan_Kim_0-1672566819179.png

 

Value 2010 measure: = 
CALCULATE ( [Value total measure:], 'Year'[Year] = 2010 )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

7 REPLIES 7
sverderame
Helper I
Helper I

I figured out how to apply the correct date, that's all that was needed. Thanks again for all of your help!

sverderame
Helper I
Helper I

I found where the glitch is. Its becasue I am using a dates table for the slicer, when I select Dates, hierachy, years it does not work. If I select, years on its own, it works perfectly, however, the slicer now, instead of just showing the years shows a month, day, year format that ruins my other visuals.

sverderame
Helper I
Helper I

Hello, for some reason this DAX is not working for me. It applies the correct value from 2010 and higher but when I select 2009, the value turns "Blank"

 

Everything in your files seems to match mine, the relationships seem to be in order. I can't figure out why it is not working when I select a year previous to 2010.

sverderame
Helper I
Helper I

Thank you so much, that worked like a charm! Happy New Year!

Jihwan_Kim
Super User
Super User

Hi,

I do not know how your data model looks like, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

I hope the below can provide some ideas on how to create a solution for your data model.

Jihwan_Kim_0-1672541261414.png

 

Jihwan_Kim_1-1672541397133.png

 

 

Value maxyear measure: =
CALCULATE ( [Value total measure:], 'Year'[Year] = MAX ( 'Year'[Year] ) )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Hi, I just thought of another scenario I may want to have. I would also like to be able to return the value of say year 2010 (10) regardless of where the year slider is positioned. 

Hi,

Thank you for your message, and please check the below picture and the attached pbix file.

Jihwan_Kim_0-1672566819179.png

 

Value 2010 measure: = 
CALCULATE ( [Value total measure:], 'Year'[Year] = 2010 )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.