Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Below is my data, the second column is the unique idenfier I am trying to create a formula each month to say new/existing. If it was in previous month it is existing if it wasn't its new. I have tried so many ways and just can't get it. Right now I only have Feb/Mar data loaded. Thanks in advance.
Solved! Go to Solution.
Hi @Anonymous ,
You can create a measure as below:
New/Existing =
VAR _curperiod =
SELECTEDVALUE ( 'SBU'[Report Period] )
VAR _curid =
SELECTEDVALUE ( 'SBU'[ID] )
VAR _count =
CALCULATE (
COUNT ( 'SBU'[ID] ),
FILTER (
ALL ( 'SBU' ),
'SBU'[ID] = _curid
&& 'SBU'[Report Period] <= _curperiod
)
)
RETURN
IF ( _count > 1, "Existing", "New" )
If the above one is not working for your scenario, please provide your expected result with sample or screenshot. Thank you.
Best Regards
Hi @Anonymous ,
You can create a measure as below:
New/Existing =
VAR _curperiod =
SELECTEDVALUE ( 'SBU'[Report Period] )
VAR _curid =
SELECTEDVALUE ( 'SBU'[ID] )
VAR _count =
CALCULATE (
COUNT ( 'SBU'[ID] ),
FILTER (
ALL ( 'SBU' ),
'SBU'[ID] = _curid
&& 'SBU'[Report Period] <= _curperiod
)
)
RETURN
IF ( _count > 1, "Existing", "New" )
If the above one is not working for your scenario, please provide your expected result with sample or screenshot. Thank you.
Best Regards
I get this to work in a measure. Can it be created in a column?
Hello, all data is in one table?
Hi, @Anonymous
Do you have custom-date-table ?
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Schedule a short Teams meeting to discuss your question
Yes, I have a standardard date table
Hi, @Anonymous
Then you can create one measure as I mentioned above.
All data come from the date table, and your main table.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Schedule a short Teams meeting to discuss your question
Hi, @Anonymous
Please correct me if I wrongly understand your question.
Inside your measure, please try to define the below by using VAR.
first table: VALUES(customersID-culumn) as current month customer, and
second table: calculatetable (VALUES(customersID-culumn), filter(alldatestable, monthnumber = maxmonthnumber-1)) as previous month customer.
intersect (first table, second table) = existing customers table
except (first table, second table) = new customer table
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Schedule a short Teams meeting to discuss your question
User | Count |
---|---|
84 | |
77 | |
75 | |
43 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
45 | |
43 |