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
Anonymous
Not applicable

How to load table data by Max date by default and will changes accordingly by user's date selection

Hi,

@amitchandak @Greg_Deckler @ImkeF @parry2k

I have a table with load date and the requirement is to load data by max load date when it will load for the first time, but there is also a Filter drop down with load date and when the user will select another date , the table will load with that date.

TO achieve this I have used below measure :

Measure 2 =
var vMaxLoadDate = CALCULATE ( MAX ( EDG_COUNT_STATUS[Date] ), ALL ( 'EDG_COUNT_STATUS' ) )
return
IF(MIN(EDG_COUNT_STATUS[Date]) = vMaxLoadDate,1,0)

and set it as filter in visual filter level and set the value to it as 1. But it always load data with latest date, but when I am going to select another date from filter dropdown it does not chnage the dates in the table.

But my requirement is to load table with selected date as well as by Max load by default.

Capture.jpg

How can i achive this? Below is the screen shot for reference:

 

So by default it is loaded with 03/15/2020 which is max load date, but when ever I am going to select another date from filter values, it does load with that date.

 

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,

I have solved it by below measure:


Load Date =
var vMaxLoadDate = IF(ISFILTERED(EDG_COUNT_STATUS[Date]),SELECTEDVALUE(EDG_COUNT_STATUS[Date]), CALCULATE ( MAX ( EDG_COUNT_STATUS[Date] ), ALL ( 'EDG_COUNT_STATUS' ) ))
//var vMaxLoadDate = CALCULATE ( MAX ( EDG_COUNT_STATUS[Date] ), ALL ( 'EDG_COUNT_STATUS' ) ))
//IF( MIN(EDG_COUNT_STATUS[Date]) = vMaxLoadDate ,1,0)
return vMaxLoadDate

 

and use 'Load Date' as measure column in the table , but you need to uncheck the 'Totals', as 'Load Date' is a measure, and it will show selected date in totals.

but you can't select more than one Date value from Date filter dropdown.

 

and it works well for me.

 

 

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

You might need to use is filtered and change calculations based on that

Measure 2 =
var vMaxLoadDate = CALCULATE ( MAX ( EDG_COUNT_STATUS[Date] ), ALL ( 'EDG_COUNT_STATUS' ) )
return
if(isfiltered('Data'[Date]),
calculate([measure],filter(EDG_COUNT_STATUS,EDG_COUNT_STATUS[Date]=vMaxLoadDate)),
calculate([measure])
)

 

https://powerpivotpro.com/2013/03/hasonevalue-vs-isfiltered-vs-hasonefilter/

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

what is measure here?

Measure 2 =
var vMaxLoadDate = CALCULATE ( MAX ( EDG_COUNT_STATUS[Date] ), ALL ( 'EDG_COUNT_STATUS' ) )
return
if(isfiltered('Data'[Date]),
calculate([measure],filter(EDG_COUNT_STATUS,EDG_COUNT_STATUS[Date]=vMaxLoadDate)),
calculate([measure])
)

I dont understand. Please explain your thout about it.

 

Anonymous
Not applicable

Hi,

Can any one suggest that how can we achieve this thing: How to load table data by Max date by default and will changes accordingly by user's date select

 

please give me an idea about it.

 

Anonymous
Not applicable

Hi,

I have solved it by below measure:


Load Date =
var vMaxLoadDate = IF(ISFILTERED(EDG_COUNT_STATUS[Date]),SELECTEDVALUE(EDG_COUNT_STATUS[Date]), CALCULATE ( MAX ( EDG_COUNT_STATUS[Date] ), ALL ( 'EDG_COUNT_STATUS' ) ))
//var vMaxLoadDate = CALCULATE ( MAX ( EDG_COUNT_STATUS[Date] ), ALL ( 'EDG_COUNT_STATUS' ) ))
//IF( MIN(EDG_COUNT_STATUS[Date]) = vMaxLoadDate ,1,0)
return vMaxLoadDate

 

and use 'Load Date' as measure column in the table , but you need to uncheck the 'Totals', as 'Load Date' is a measure, and it will show selected date in totals.

but you can't select more than one Date value from Date filter dropdown.

 

and it works well for me.

 

 

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