cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Stuznet Member
Member

Use measure as Filter

Hi,
I’m struggling with a simple DAX.
I created a measure to compare month and year between two dates.

Measure = CALCULATE(Count[Column1]), FILTER(Table, MONTH([Date1]) = MONTH([Date2]) && YEAR([Date1]) = YEAR([Date2])))

Now I want to create a calculated column and use it as filter
Column = IF([Measure] >1, “March”, “ Not March”)

I can’t seems to get it to work.

Can some1 help?

Much appreciate!!
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Use measure as Filter

@Stuznet add a column 

 

 New Column = 
IF( MONTH([Date1]) = MONTH([Date2]) && YEAR([Date1]) = YEAR([Date2]), "Matched", "Not Matched" )



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

Proud to be a Datanaut! Connect with me on Linkedin






4 REPLIES 4
Highlighted
Super User
Super User

Re: Use measure as Filter

@Stuznet add a column 

 

 New Column = 
IF( MONTH([Date1]) = MONTH([Date2]) && YEAR([Date1]) = YEAR([Date2]), "Matched", "Not Matched" )



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

Proud to be a Datanaut! Connect with me on Linkedin






Stuznet Member
Member

Re: Use measure as Filter

Hi @parry2k,

I’ve tried that too. When I filtered to matched is giving me the one that is not matching too. When I filter to Not Matched is giving me blank
Super User
Super User

Re: Use measure as Filter

@Stuznet would you mind sharing sample data and also if you can mention which records are showing wrong, will help.

 

 




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

Proud to be a Datanaut! Connect with me on Linkedin






Stuznet Member
Member

Re: Use measure as Filter

@parry2k 

I think I got it.


This is what I did.

First, I create a measure

Measure  = COUNT([Product])

Second, I create a calculated column

Comparison = IF(MONTH([Received Date]) = MONTH([Date Submitted]) && YEAR([Received Date]) = YEAR([Date Submitted]),"Matched", "Not Matched")

Capture.PNG

 

Thank you for your help Smiley Happy