Forum Discussion

OliviaM's avatar
OliviaM
New Member
1 year ago
Solved

How to set a default value

I've created a Power BI report to track the completion rate of online training modules per Business Unit. This report includes two charts: Chart 1: Completion rate per module This chart allows fil...
  • BeaBF's avatar
    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

  • v-ssriganesh's avatar
    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.

  • Anonymous's avatar
    Anonymous
    1 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.