cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
being_mohit16 Frequent Visitor
Frequent Visitor

Need Help with performing measure within "Measure"

I'm trying to calculate some criteria in a column using "if" condition(looping), but it's only checking the first "if" condition and giving the single value (IF([% of Assets added during the Quarter] >= 5, 5,). 
When I'm using the same formula in the measure column then it is working correctly.
After creating criteria I have to find out an average of it also.
--------------------------------------------------------------------------------------------------------------------
DAX Formulas  for Criteria: Avila Score Crit = IF(ISBLANK([% of Assets added during the Quarter]), BLANK(),
IF([% of Assets added during the Quarter] >= 5, 5,
IF(AND([% of Assets added during the Quarter] < 3.5, [% of Assets added during the Quarter] > 5),3,
IF([% of Assets added during the Quarter] <=3.5,1)))) 
----------------------------------------------------------------------------------------------------------------------
Avila Score is "Measure" and after this is "Column".

WhatsApp Image 2019-05-09 at 8.46.01 PM.jpeg

3 REPLIES 3
DAXRichArd Member
Member

Re: Need Help with performing measure within "Measure"

Hi being_mohit16,

 

I'm still a practicianer in DAX. I'm having trouble following your inquiry (your question).

If you have two conditions that need to be met, instead of using IF, you can try SWITCH with AND. SWITCH for me is easier, but I have occasions when I still use IF.

 

Column Name =

     SWITCH (

     TRUE () ,

     AND (

          logic test 1 = "what your looking for",

          logic test 2 = "what your looking for"

          )

          = TRUE(), result if  true,

           result if falseI

)

 

I tested the formula above on a data set I'm using and it worked. It looked like this:

 

Test =
SWITCH(
TRUE(),
AND('FT Airlines'[Airline] = "Air France Cargo",'FT Airlines'[Direction] = "Departure") = TRUE(), "MATCH",
"NO MATCH")
 
Be sure to use the quotation marks for your logic test. If the result you want for a match or no match is a column, write the Table[Column]. Else enclose your desired result in quotation marks.
 
Hope this helps. Have a great day!
DAXRichArd
being_mohit16 Frequent Visitor
Frequent Visitor

Re: Need Help with performing measure within "Measure"

@DAXRichArd
Thanks for suggestions, but i tried it is calculating measure for all the column thats Why results is not coming, so i used value () function to get identical column.
DAXRichArd Member
Member

Re: Need Help with performing measure within "Measure"

Hello,

One more thought. DAX does not accept a table as a measure. If your DAX code results in what would end up being a talbe, if you write it as a measure you'll get an error. Nevertheless, you can use a table in a measure as a filter function that then aggregates the filter context.

Good luck.

RM

Helpful resources

Announcements
New Kudos Received Badges Coming

New Kudos Received Badges Coming

Kudos to you if you earned one of these! Check your inbox for a notification.

Microsoft Implementation for Communities Wins Award

Microsoft Implementation for Communities Wins Award

Learn about the award-winning innovation that was implemented across Microsoft’s Business Applications Communities.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (3,688)