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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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.


@ 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!:
The Definitive Guide to Power Query (M)

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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