Forum Discussion
How to set a default value
- 1 year ago
OliviaM Hi!
Instead of directly using the completion rate column, create a measure that dynamically adjusts based on the selection, like:
Completion Rate Display =
VAR SelectedModules = SELECTEDVALUE(TrainingModules[ModuleName], "ALL")RETURN
IF(
SelectedModules = "ALL",
AVERAGEX(ALL(TrainingModules), [CompletionRate]), -- Calculate overall average when nothing is selected
AVERAGE([CompletionRate]) -- Otherwise, calculate based on selection
)BBF
- 1 year ago
Hi OliviaM,
Thank you for reaching out to the Microsoft Fabric Forum Community.I’ve reproduced your scenario using sample data matching your raw data structure and achieved the expected output. Added the following DAX measures to the table.
Completion Rate BU = VAR SelectedModules = ISFILTERED( 'table'[Module Name] ) RETURN IF( SelectedModules, AVERAGE( 'table'[Completion Rate] ), CALCULATE( AVERAGE( 'table'[Completion Rate] ), ALL( 'table'[Module Name] ) ))The .pbix file attached demonstrates this working solution with your sample data.
If this information is helpful, please “Accept it as a solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you. - Anonymous1 year ago
Hi OliviaM ,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
Thank you all for your answers! It's really helpful. I will keep you posted : )