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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
lassuied
Advocate I
Advocate I

Using the result of a DAX formula as a Parameter

Hello Everyone,

 

I created a table called "Parameters" and a measure in this table called "YearReport".

 

In DAX I have done a simple formula where : YearReport = 2017

 

Now I would like to use this to filter my other DAX but Power BI doesn't let me use the filter ... the thing is if I type 2017 in the filter it is working, but not the DAX, here is an example :

 

CountofContractsCY = calculate(COUNTA(v_e2AllColumns[ContractDetail_NumberUnderContract]),'1_PrincipaleTable2'[Scenarios]=[YearReport],v_e2AllColumns[LotDemographics_IsPhysicalLocationFlag]=True)

 

Is there anything else I can do to keep that dynamicity ?

 

Thank you !

 

1 ACCEPTED SOLUTION

Thank you for your reply ! I was continuing in digging and I found out that no relationship existed between my parameters table and the other ones ... Thank you for your help though !

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

There could be lots going on here. Are you getting an error in your DAX? Are you sure that your YearReport and Scearios are of the same data type? Some sample/mock source data would be helpful. Might also want to investigate VAR perhaps. You might have to use an aggregation function in your formula, like MAX([YearReport]). Tough to say.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Thank you for your reply ! I was continuing in digging and I found out that no relationship existed between my parameters table and the other ones ... Thank you for your help though !

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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