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! Learn more

Reply
Anonymous
Not applicable

Advanced filtering of rows to show price of "current" product

Hi,

I got a price table structured like the one below. I need a dynamic DAX statement that will be used to plot the price on a line chart. It needs to plot the rows with the lowest ProductYear TODAY or the last date. In the example below, I would want to only show the price for 2019, since 2020 values have started to tick in and values for 2018 are no longer being reported.


DateProductProductYearPrice
01.01.2018JAN-18201820,2
01.01.2018JAN-19201922,15
02.01.2018JAN-18201820,5
02.01.2018JAN-19201922,55
03.01.2018JAN-19201922,7
03.01.2018JAN-20202020,22




In other words, the data I would want to plot if today was 02.01.2018 would be this

DateProductProductYearPrice
01.01.2018JAN-18201820,2
02.01.2018JAN-18201820,5


And if today was 03.01.18 I would want this to be plotted.

DateProductProductYearPrice
01.01.2018JAN-19201922,15
02.01.2018JAN-19201922,55
03.01.2018JAN-19201922,7


Thanks for any help  🙂

5 REPLIES 5
Anonymous
Not applicable


Hi,

I got a price table structured like the one below. I need a dynamic DAX statement that will be used to plot the price on a line chart. It needs to plot the rows with the lowest ProductYear TODAY or the last date. In the example below, I would want to only show the price for 2019, since 2020 values have started to tick in and values for 2018 are no longer being reported.


DateProductProductYearPrice
01.01.2018JAN-18201820,2
01.01.2018JAN-19201922,15
02.01.2018JAN-18201820,5
02.01.2018JAN-19201922,55
03.01.2018JAN-19201922,7
03.01.2018JAN-20202020,22


Thanks for any help 🙂

Hi

it seems the condition " the lowest ProductYear TODAY or the last date" and "only show the price for 2019" are contradictory.

i used the example dataset and get the result as the first picture based on the condition of "lowest productyear and last date from today".

6.png

7.png

Could you help me more clear about the criterion to get the expected table?

 

 

Best Regards

Maggie

 

Anonymous
Not applicable

I think you got a today mixed into that example data by the way, since I don't think I listed a row with the date 4/27/18 

Hi @Anonymous

After struggling with this problem, I finally figure out a solution, here is my pbix for your reference.

 

Best Regards

Maggie

Anonymous
Not applicable

Sorry for the late reply!

I'll simplify it a little, so the criterion would be as follows.

Based on the latest date in the "Date" column, I need to plot the price for the rows that contain the lowest productyear.

Every date will have several rows for different products. 2018, 2019, 2020 etc. These can be traded like a future, but they will become untradeable at some point in time. When 2018 is no longer tradeable, there will be no new rows coming into the dataset, but the old rows will remain and need to be filtered out. Which is what happens between 02.01.18 and 03.01.18 in my example. The "active rows" goes from being the ones with 2018 to 2019. (The date formating in this example is DDMMYY btw).

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