Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
menphis21
Helper IV
Helper IV

Using a parametrer in dax for all the app?

HI
i have an app that i need to update all quarter.

 I want to create a parameter, for example Actual_Quarter = "Q1", and then use this parameter inside a DAX measure.

For instance, I want to create a measure like:

Market Cap = CALCULATE( SUM('DB'[value]), FILTER('DB', 'DB'[variable] = "Market Capitalization"), -- Filter using the parameter here )

How can I define such a parameter and use it effectively in the CALCULATE() function?

Thanks

1 ACCEPTED SOLUTION

Hello,
Thank you.
I found another solution.
you can create a parameter in Power Query ( Manage Parameters - New Parameter) and for example create Year = 2025
you need to right click on this parameter and enable Load enable.

and as you will be able to change your parameter, it will be updated after a refresh.

 

Thanks

View solution in original post

3 REPLIES 3
v-karpurapud
Community Support
Community Support

Hi @menphis21 

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.

v-karpurapud
Community Support
Community Support

Hello @menphis21 


Welcome to the Microsoft Fabric Forum,
 

Regarding the measure to dynamically filter your data by quarter using a parameter in DAX,

 

1. Create a disconnected parameter table to allow flexible quarter selection:

   

    DAX:
    

QuarterParameter = DATATABLE(
    "Quarter", STRING,
    {{"Q1"}, {"Q2"}, {"Q3"}, {"Q4"}}
)

 

2. Add a slicer to your report using the QuarterParameter[Quarter] column. This enables users to select the active quarter dynamically.

 

3. Define a new measure that captures the user's selection and includes a default value to avoid errors:
    
   DAX:
   

SelectedQuarter = SELECTEDVALUE(QuarterParameter[Quarter], "Q1")

 

4. Create Market Cap measure to incorporate the selected quarter as a filter:
  
    DAX: 
   

Market Cap =
VAR Selected = [SelectedQuarter]
RETURN
CALCULATE(
    SUM('DB'[value]),
    'DB'[variable] = "Market Capitalization",
    'DB'[Quarter] = Selected
)


5. Make sure that the 'DB'[Quarter] column has values in the same format as your parameter table (e.g., "Q1", "Q2"). If necessary, you can format or extract the quarter from a date column using Power Query or DAX

 


If this information helps resolve your issue, kindly consider marking this response as the Accepted Solution, as it may assist other community members facing similar challenges.

 

Thank you for being part of the Microsoft Fabric Community.



 

Hello,
Thank you.
I found another solution.
you can create a parameter in Power Query ( Manage Parameters - New Parameter) and for example create Year = 2025
you need to right click on this parameter and enable Load enable.

and as you will be able to change your parameter, it will be updated after a refresh.

 

Thanks

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.