Forum Discussion
KOCHA
2 years agoNew Member
measure a label
Hello, I'm a relatively new user of Power BI. I want to create a measure. For example, all the clients enrolled in the last month (registration date is already a field in my database) are marked as ...
marcelsmaglhaes
Super User
2 years agoHi KOCHA
If you want label a new customer, is better create a New Column in the customers table. If you wanna do that using DAX, you can try the measure bellow.
If this post helps, please mark as solved.
Regards,
Marcel
new_customer=
VAR __current_month = MONTH(TODAY())
VAR __current_year = YEAR(TODAY())
VAR __current_year = YEAR(TODAY())
RETURN
IF(
YEAR(YOUT_TABLE[REGISTRATION_DATE]) = __current_year &&
( MONTH(YOUT_TABLE[REGISTRATION_DATE]) = __current_month ||
MONTH(YOUT_TABLE[REGISTRATION_DATE]) = __current_month-1) , "NEW CUSTOMER",
( MONTH(YOUT_TABLE[REGISTRATION_DATE]) = __current_month ||
MONTH(YOUT_TABLE[REGISTRATION_DATE]) = __current_month-1) , "NEW CUSTOMER",
"old customer")
- KOCHA2 years agoNew Member
Unfortunately, it doesn't work. The visual doesn't display when I added this new measure.
- marcelsmaglhaes2 years ago
Super User
You created a calculated column? Tutorial: Create calculated columns in Power BI Desktop - Power BI | Microsoft Learn
- mlsx42 years ago
Memorable Member
Hi KOCHA
Do you have a column with "new" as values or do you need a column to create it?
Also, can you share how is your data structured? You can put A, B, C 1234 to keep confidentiality- KOCHA2 years agoNew Member
I can't create it because the dashboard is directly on another database source. Let me check if there is a workaround. Thanks.