Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
KOCHA
New 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 "NEW". How can I do that?

Thanks for your advice.

KOCHA

5 REPLIES 5
marcelsmaglhaes
Super User
Super User

Hi @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())
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",
            "old customer")

Regards,
Marcel Magalhães
Microsoft Power BI Official Partner
MCT | Certified PL-300 Power BI

If I've helped, don't forget to mark my post as a solution!
Imagem de fundo



Unfortunately, it doesn't work. The visual doesn't display when I added this new measure.

 

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

I can't create it because the dashboard is directly on another database source. Let me check if there is a workaround. Thanks.

 

You created a calculated column? Tutorial: Create calculated columns in Power BI Desktop - Power BI | Microsoft Learn


Regards,
Marcel Magalhães
Microsoft Power BI Official Partner
MCT | Certified PL-300 Power BI

If I've helped, don't forget to mark my post as a solution!
Imagem de fundo



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.