Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi ,
I have a requirement in my PBI report.
In a filter panel Month filter ,If I select months it should give me Max of selected month,If i dont select any month it shd give default month as current month -2,third requirement ,If i select all in the filter,it should give me max of month .
I have achieved the first two ,3rd requirement 'select all ',I am not able to achieve ..can anyone give me some suggestions or inputs on this
Here's a query i have used
Solved! Go to Solution.
@r-e , To achieve the desired result please update dax as below
SlicerSelection1 =
VAR SelectedMonths = VALUES(CalendarTable[Month Year])
VAR MaxMonth = MAX(CalendarTable[Month Year])
VAR DefaultMonth = FORMAT(EDATE(TODAY(), -2), "Mmm-yy")
VAR MaxSelectedMonth = FORMAT(MAX(SelectedMonths), "Mmm-yy")
RETURN
IF (
ISFILTERED(CalendarTable[Month Year]),
IF (
COUNTROWS(SelectedMonths) = COUNTROWS(ALL(CalendarTable[Month Year])),
"Selected Month by: " & MaxMonth,
"Selected Month by: " & MaxSelectedMonth
),
"Selected Month by: " & DefaultMonth
)
Proud to be a Super User! |
|
@r-e , To achieve the desired result please update dax as below
SlicerSelection1 =
VAR SelectedMonths = VALUES(CalendarTable[Month Year])
VAR MaxMonth = MAX(CalendarTable[Month Year])
VAR DefaultMonth = FORMAT(EDATE(TODAY(), -2), "Mmm-yy")
VAR MaxSelectedMonth = FORMAT(MAX(SelectedMonths), "Mmm-yy")
RETURN
IF (
ISFILTERED(CalendarTable[Month Year]),
IF (
COUNTROWS(SelectedMonths) = COUNTROWS(ALL(CalendarTable[Month Year])),
"Selected Month by: " & MaxMonth,
"Selected Month by: " & MaxSelectedMonth
),
"Selected Month by: " & DefaultMonth
)
Proud to be a Super User! |
|
Super! ! !
let me try
Hi @r-e ,
Pls has your problem been solved? If so, accept the reply as a solution. This will make it easier for the future people to find the answer quickly.
If not, please provide a more detailed description, preferably some dummy sample data, and the expected results.
Best Regards,
Stephen Tao
Hello @r-e ,
You can modify your query to check if all months are selected and then return the maximum month available. Here’s an updated version of your DAX query that includes logic for the "Select All" scenario
SlicerSelection1 =
VAR Months =
"Selected Month by: " & FORMAT(MAX(CalendarTable[Max-2]), "MMM-yy")
VAR MaxMonth =
"Month: " & FORMAT(MAX(CalendarTable[Max-Month]), "MMM-yy")
VAR Maxselectedmon =
IF(
ISFILTERED(CalendarTable[Month Year]),
"Selected Month: " & FORMAT(MAX(CalendarTable[MaxSelectedMonth]), "MMM-yy"),
MaxMonth)
VAR SelectedMonthCount = COUNTROWS(VALUES(CalendarTable[Month Year]))
RETURN
IF(
ISFILTERED(CalendarTable[Default Selection]),
"Selected Year: " & CONCATENATEX(VALUES(CalendarTable[Default Selection]), CalendarTable[Default Selection], ASC) & UNICHAR(10),
IF(
SelectedMonthCount = COUNTROWS(ALL(CalendarTable[Month Year])),
"Selected Month by: " & FORMAT(MAX(CalendarTable[MaxSelectedMonth]), "MMM-yy"),
"Selected Month by: " & Months))
If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes 👍 are much appreciated!
Thank You
Dharmendar S
User | Count |
---|---|
120 | |
65 | |
62 | |
56 | |
50 |
User | Count |
---|---|
181 | |
85 | |
67 | |
62 | |
55 |