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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Hurshemar
Regular Visitor

User Input in DAX Query

Hello,

 

I have a project set up that is pulling in data from an accounting system.  Right now I am pulling in data for "2023_Scenario_1" which is hard coded in my DAX query.  I want to be able to have a user select this scenario and have it push that selection into this query.  I tried created a new paramater called"Selected Scenario" and I replaced the "2023_Scenario_1" below with @Selected_Scenario but I got an error that this paramter wasn't declared.

 

EVALUATE
SUMMARIZECOLUMNS (
'Organization'[Asset Final Desc],
'Organization'[Asset Desc],
'FactFinance'[DimCompanyID],
'FactFinance'[DimScenarioID],
'DateGL'[YYYYMM],
'FactFinance'[DimProductID],
'ProjectType'[Project Type Level 1 Name],
FILTER(FactFinance, FactFinance[DimScenarioID] IN {"2023_Scenario_1"}),
FILTER(Versions, Versions[Versions] IN {"Final"}),
FILTER(DateGL, DateGL[YYYYMM] >= "202310"),
FILTER(DateGL, DateGL[Balance Type] IN {"Monthly Balance"}),
FILTER(GrossNet, GrossNet[Gross-Net] IN {"Net"}),
"Total Expense", [Total Expense],
"Revenue", [Revenue],
"Royalties", [Royalties],
)

1 ACCEPTED SOLUTION
MattAllington
Community Champion
Community Champion

I've taught 10s of thousands of people DAX. I've seen it all. Normally when I see this approach (DAX queries) it comes from someone that has a SQL background. Generally speaking, this is not how you should approach power BI. Instead do the following

  • Prepare your data in a star schema
  • Load all the data you will need for all reports. You should never have to refresh the report based on different user data needs
  • add slicers to the page to apply filters
  • forget about writing queries. Instead use the visuals (start with table and matrix) to visually build the output you need. The visual creates the structure/group bys, etc, and measures are replacements for aggregations. 


* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

View solution in original post

1 REPLY 1
MattAllington
Community Champion
Community Champion

I've taught 10s of thousands of people DAX. I've seen it all. Normally when I see this approach (DAX queries) it comes from someone that has a SQL background. Generally speaking, this is not how you should approach power BI. Instead do the following

  • Prepare your data in a star schema
  • Load all the data you will need for all reports. You should never have to refresh the report based on different user data needs
  • add slicers to the page to apply filters
  • forget about writing queries. Instead use the visuals (start with table and matrix) to visually build the output you need. The visual creates the structure/group bys, etc, and measures are replacements for aggregations. 


* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.