Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have to create a card to display just the selected month name. My code below insn't working...any recommendations.
Requirements:
If no months are selected, then display blank.
If multiple months are selected, display the max month.
MaxSelectedMonth:=
var SelectedMonth = Format(max('Forecast Calendar'[Month]),"MMM")
return
If (ISBLANK(SelectedMonth),BLANK(),SelectedMonth)
Solved! Go to Solution.
Hi @Anonymous,
By my tests, you could modify your fomula like below.
MaxSelectedMonth =
VAR maxselected =
CALCULATE (
MAX ( 'Table1'[Month] )
)
RETURN
IF ( ISFILTERED ( Table1[Month] ), maxselected )
You may create another measure by SWITCH to show the Month Name.
MaxSelectedMonth_ = SWITCH ( [MaxSelectedMonth], 1, "January", 2, "February", 3, "March", 4, "April", 5, "May", 6, "June", 7, "July", 8, "August", 9, "September", 10, "October", 11, "November", 12, "December" )
Then create a card visual with MaxSelectedMonth_ measure, you will get the output you expected.
Hope this can help you!
Best Regards,
Cherry
That did not work. I get "Blank" when I click on a Month
MaxSelectedMonth1 =
VAR maxselected =
CALCULATE (
MAX ( 'Forecast Calendar'[Month])
)
RETURN
IF ( ISFILTERED ( 'Forecast Calendar'[Month]), maxselected )
SOLVED BY USING
MaxSelectedMonth:= "Bookings " & LOOKUPVALUE(
'Forecast Calendar'[Month Year],
'Forecast Calendar'[Relative Month Index],
[MaxSelectedRelativeMonth]
)
Hi @Anonymous,
By my tests, you could modify your fomula like below.
MaxSelectedMonth =
VAR maxselected =
CALCULATE (
MAX ( 'Table1'[Month] )
)
RETURN
IF ( ISFILTERED ( Table1[Month] ), maxselected )
You may create another measure by SWITCH to show the Month Name.
MaxSelectedMonth_ = SWITCH ( [MaxSelectedMonth], 1, "January", 2, "February", 3, "March", 4, "April", 5, "May", 6, "June", 7, "July", 8, "August", 9, "September", 10, "October", 11, "November", 12, "December" )
Then create a card visual with MaxSelectedMonth_ measure, you will get the output you expected.
Hope this can help you!
Best Regards,
Cherry
That did not work. I get "Blank" when I click on a Month
MaxSelectedMonth1 =
VAR maxselected =
CALCULATE (
MAX ( 'Forecast Calendar'[Month])
)
RETURN
IF ( ISFILTERED ( 'Forecast Calendar'[Month]), maxselected )
SOLVED BY USING
MaxSelectedMonth:= "Bookings " & LOOKUPVALUE(
'Forecast Calendar'[Month Year],
'Forecast Calendar'[Relative Month Index],
[MaxSelectedRelativeMonth]
)
hi @Anonymous
Try this revision
MaxSelectedMonth = VAR SelectedMonth = FORMAT ( MAX ( 'Forecast Calendar'[Month] ), "MMM" ) RETURN IF ( ISFILTERED ( 'Forecast Calendar'[Month] ), SelectedMonth )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |