Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi I'm new to power bi ,I need to get the latest date as default when the power bi desktop is refreshed using slicer chart.I tried some measure like LASTDATE and used in filter but the data is not reflecting and used Relative date function eventhough I didn't get what I expected .At last I tried to convert it into Text data type and used to equate with today() function in IF statement .It worked but giving only the specified today date but I need including the whole data up to today date and needs to change every week monday automatically after refresh.Can anyone provide me an answer or a suggestion?
Solved! Go to Solution.
Hi, @Jetlee_V
Measure = IF(SELECTEDVALUE(Sheet1[First Monday])=CALCULATE(MAX(Sheet1[First Monday]),ALL(Sheet1)),1,0)
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Jetlee_V
Can you provide sample data for testing? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures or Excel. I look forward to your response.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-zhangti ,
The required file is attached below, here I tried the above said methods but, I'm not getting the required answer.So, I'm reposting the requirement again the Slicer which is in blue colour should display the recent Monday date as default and it needs to give the data from earliest date till Monday(If today is Monday) or need to give data till last Monday of present week.
Demo_file
Thanks in advance,
Jetlee
Hi, @Jetlee_V
Measure = IF(SELECTEDVALUE(Sheet1[First Monday])=CALCULATE(MAX(Sheet1[First Monday]),ALL(Sheet1)),1,0)
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-zhangti ,
This is relevant answer but still I need the slicer should have all other dates among them the most recent monday should be selected as default ,but still thanks for helping for the answer that I was searching .Thanks for ur help @v-zhangti and for @123abc for the before response.
Certainly! It sounds like you want to set a default value for a slicer in Power BI that represents the latest date in your dataset. You're on the right track by using measures, but let me guide you through a step-by-step approach to achieve this:
Create a Date Table: If you don't have a Date table in your data model, create one. This table should contain all dates in your dataset. You can use the "New Table" option in Power BI and use a formula like:
DateTable = CALENDAR(MIN('YourTable'[Date]), MAX('YourTable'[Date]))
Replace 'YourTable' with the actual name of your table and 'Date' with the actual date column name.
Create a Measure for Latest Date: Create a measure that calculates the latest date in your data. You can use the following DAX formula:
LatestDate = MAX('YourTable'[Date])
Replace 'YourTable' and 'Date' as before.
Set Slicer Default Value: Now, go to the page where you have your slicer. Click on the slicer, go to the Format pane, and under General, you will find a section called "Default value." Set the default value to the measure you just created (LatestDate).
Dynamic Monday Date: If you want the default value to change every Monday, you can modify the measure for LatestDate to consider the latest Monday. You can use a formula like this:
LatestMonday = CALCULATE(MAX('YourTable'[Date]), WEEKDAY('YourTable'[Date]) = 1)
This will give you the latest Monday date in your data.
Update Default Value in Slicer: Set the default value for the slicer to be the measure LatestMonday.
Now, every time you refresh your data, the slicer will default to the latest Monday, and it will automatically update to the new Monday after each refresh. Adjust the column and table names in the formulas according to your actual data model.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.
Hi @123abc ,
I'm not able to find the "Default value" section in the general option of the Slicer's Format pane and using Power BI Desktop version
User | Count |
---|---|
84 | |
73 | |
67 | |
42 | |
35 |
User | Count |
---|---|
109 | |
56 | |
52 | |
45 | |
43 |