cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
khenatram
Regular Visitor

Adding COUNTIF  as a custom measure

I have 2 pivot tables  with following details

Name Allocation 

 

I am using COUNTIF to identify if Name from Table 1 is present in Table 2 and if yes, what is the allocation.

 

=IF(COUNTIF($I:$I, $A6)=0, "Not Planned in FY21", IF(SUMIF($I:$I, $A6,$J:$J) =1, "100% planned in FY21",IF(SUMIF($I:$I, $A6,$J:$J) =0, "Needs Project Allocation","Improve Allocation")))

 

A6 is name in table 1

I is the name column of Table 2

J is the alloation column of Table 2

Can I add above function as a custom measure?

 

1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@khenatram 

There are some differences in DAX compared with Excel. 

For your requirements, it can be something like this: 

 

Measure = CALCULATE(MAX('Table1'[Allocation]),FILTER('Table','Table'[Name] in VALUES('Table2'[Name])))
 
Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
V-pazhen-msft
Community Support
Community Support

@khenatram 

There are some differences in DAX compared with Excel. 

For your requirements, it can be something like this: 

 

Measure = CALCULATE(MAX('Table1'[Allocation]),FILTER('Table','Table'[Name] in VALUES('Table2'[Name])))
 
Paul Zheng _ Community Support Team
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

parry2k
Super User III
Super User III

@khenatram I didn't worked much in excel , if you can share sample data and expected output that will help to get you the solution.






Did I answer your question? Mark my post as a solution.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

Get Ready for Power BI Dev Camp

Power BI Dev Camp - September 30th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors