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

Measure as Calculate filter expression

Hi,

 

I am trying to use a measure that returns Text as a filter for Calculate function, however I am getting an error

Following are the measures:

Returning 2018 = IF([YTD 2017]>0 && [YTD 2018] >0,"Returning2018")

 

I want to use Returning 2018 measure as a filter in DAX CALCULATE function
Returning Sales 2018 =
 CALCULATE(SUM('Sales'[Net Sales]), "Calender'[Year] = "2018", [Returning 2018] = "Returning2018"))

 

Is it possible to use a measure returning text to use inside Calculate function

 

Please help, Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Measure as Calculate filter expression

@ravi3037 I should have asked how these measures are written and how does data model looks like, use FILTER function and put this measure condition in that filter function.






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

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





View solution in original post

3 REPLIES 3

Re: Measure as Calculate filter expression

@ravi3037 store measure value in a variable and then filter it. Try this

 

Returning Sales 2018 = 
VAR __val = [Returning 2018]
RETURN
CALCULATE(
SUM('Sales'[Net Sales]), 
"Calender'[Year] = "2018", 
__val = "Returning2018"
)

 






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

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





ravi3037 Frequent Visitor
Frequent Visitor

Re: Measure as Calculate filter expression

@parry2k Thanks for the reply, however I am getting the following error :

The True/False expression does not specify a column. Each True/False expressions used as a table filter expression must refer to exactly one column.

Re: Measure as Calculate filter expression

@ravi3037 I should have asked how these measures are written and how does data model looks like, use FILTER function and put this measure condition in that filter function.






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

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





View solution in original post

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 Kudoed Authors (Last 30 Days)
Users online (1,115)