To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi everyone,
I would like to display in a dax formula the selection "From January to March" for example. (It depends on the selected values)
The reference table :
January, February, etc.
I tried this one but it doesn't work :
Solved! Go to Solution.
Hey @LD1 ,
To display a dynamic title based on the selected values for months and years, you need to handle the SELECTEDVALUE() function carefully and ensure the correct format. Try the updated version of your DAX formula:
Affichage filtre sélection mois =
"From " &
FORMAT(MIN(SELECTEDVALUE(Calendrier[Num Mois])), "MMMM") &
" to " &
FORMAT(MAX(SELECTEDVALUE(Calendrier[Num Mois])), "MMMM") &
" " &
SELECTEDVALUE('Année PM'[Year])
If there is only one month selected, both MIN and MAX will return the same month, so it will show "From January to January" (if only January is selected).
If you found this solution helpful, please consider accepting it and giving it a kudos (Like) it’s greatly appreciated and helps others find the solution more easily.
Best Regards,
Nasif Azam
Thankyou, @FBergamaschi, @Nasif_Azam and @techies for your responses.
Hi LD1,
We sincerely appreciate your inquiry submitted through the Microsoft Fabric Community Forum.
Based on my understanding, we have developed a DAX measure that dynamically selects the minimum and maximum month numbers, maps them to their respective month names, and appends the selected year to display a dynamic title.
Please find attached a screenshot and a sample PBIX file which may assist you in resolving the issue:
We hope that the information provided will be helpful. Should you have any further queries, please do not hesitate to contact the Microsoft Fabric Community.
Thank you.
Hi LD1,
We wanted to see if the information we gave helped fix your problem. If you need more help, please feel free to contact the Microsoft Fabric community.
Thank you.
Hi LD1,
We are following up to see if what we shared solved your issue. If you need more support, please reach out to the Microsoft Fabric community.
Thank you.
Hi LD1,
We would like to follow up and see whether the details we shared have resolved your problem.
If you need any more assistance, please feel free to connect with the Microsoft Fabric community.
Thank you.
Thankyou, @FBergamaschi, @Nasif_Azam and @techies for your responses.
Hi LD1,
We sincerely appreciate your inquiry submitted through the Microsoft Fabric Community Forum.
Based on my understanding, we have developed a DAX measure that dynamically selects the minimum and maximum month numbers, maps them to their respective month names, and appends the selected year to display a dynamic title.
Please find attached a screenshot and a sample PBIX file which may assist you in resolving the issue:
We hope that the information provided will be helpful. Should you have any further queries, please do not hesitate to contact the Microsoft Fabric Community.
Thank you.
Hi @LD1 what is in the 'Année PM' table?
Hey @LD1 ,
To display a dynamic title based on the selected values for months and years, you need to handle the SELECTEDVALUE() function carefully and ensure the correct format. Try the updated version of your DAX formula:
Affichage filtre sélection mois =
"From " &
FORMAT(MIN(SELECTEDVALUE(Calendrier[Num Mois])), "MMMM") &
" to " &
FORMAT(MAX(SELECTEDVALUE(Calendrier[Num Mois])), "MMMM") &
" " &
SELECTEDVALUE('Année PM'[Year])
If there is only one month selected, both MIN and MAX will return the same month, so it will show "From January to January" (if only January is selected).
If you found this solution helpful, please consider accepting it and giving it a kudos (Like) it’s greatly appreciated and helps others find the solution more easily.
Best Regards,
Nasif Azam
Hi @LD1
SELECTEDVALUE() returns the only visibile value of a column in the current filter context (or a BLANK if there is more than one value is visible - or the optional second input if you want something different than BLANK in case of multiple values), so it does not apply to any MIN/MAX
Without more info on your model, I can only suggest to use
Affichage filtre sélection mois = "From " & MIN(Calendrier[Num Mois]) & " to " & MAX(Calendrier[Num Mois]) & " " & SELECTEDVALUE('Année PM'[Year]))
The fact that the lst SELECTEDVALUE works assumes you are bounded to a single year, other wise (having months in different years) we should change the approach
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
User | Count |
---|---|
14 | |
11 | |
6 | |
6 | |
5 |
User | Count |
---|---|
29 | |
17 | |
11 | |
7 | |
5 |