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
NISH72
Helper IV
Helper IV

How to refer a measure in Sim function

Hi I have the following measure with formula - ( If[ measure 1] ,1,0). I want to sum the total number of '1' for this measure. But when I create a measure with sum function ,it is not showing the following measure in it. Please can someone help me. I can't create a calculated column for the above measure due to circular dependency error. Thanks
1 ACCEPTED SOLUTION

Hey @NISH72 ,

 

this does not clarify the potential outcome of [measure 1], provide the DAX code for [mesure 1].

I still assume that using SUMX() will be part of the solution.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

6 REPLIES 6
Greg_Deckler
Super User
Super User

SUM works with columns. The question is, sum this measure over what? This looks like a measure aggregation problem. See my blog article about that here: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149


@ 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...
TomMartens
Super User
Super User

Hey @NISH72 ,

 

basically it's not clear what the measure [measure 1] will return ...

You might look into one of the table iterator functions like SUMX and create a measure like so:

SUMX(
	'table' 	//the table to iterate
	, IF([measure 1] ... //the condition
	, 1			//true
	, BLANK() 	//false
	)
)

If this does not help, please create a pbix that contains sample data, upload the file to onedrive or dropbox and share the link.

 

Don't forget to describe the expected outcome based on your sample data.

 

Regards,

Tom

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Thank you for your reply. I have the following measure with dax- ( If[ measure 1] ,1,0). I want to create the another measure that would sum the total number of 1 for previous measure.
Eg
Measure1 = ( If[ measure] ,1,0)
Measure2 = sum(measure1)
But measure2 won't refer measure1 and I can't create a calculated column for measure1 dax due to circular dependency. Thanks

Hey @NISH72 ,

 

this does not clarify the potential outcome of [measure 1], provide the DAX code for [mesure 1].

I still assume that using SUMX() will be part of the solution.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

The dax code for measure1- ( If[ measure] ,1,0). It refers to a previous measure and shows 1 if condition is true.

Hey @NISH72 ,

 

I doubt that, as there is a syntax issue IF[measure], 1, 0) should look like IF([measure], 1, 0)

 

Nevertheless, try this for measure 2:

SUMX(
	'table' 	//the table to iterate
	, IF([measure] ... //the condition
	, 1			//true
	, BLANK() 	//false
	)
)

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

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.