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
Anonymous
Not applicable

Create new Mmasure conditionned by date

Hello,

 

I need to create a new measure to calculate the number of customers. When I select a date, the measure should calculate the number of custmers whose "fecha_baja" is biggest than this date (or null) and "fecha_alta is less than this date selected.

 

CapturaClientes.png

Cand you help me? Thanks

4 REPLIES 4
v-diye-msft
Community Support
Community Support

Hi @Anonymous 

 

you might consider creating pbix file that will contain some sample data (remove the confidential info), upload the pbix to onedrive for business and share the link to the file. Please do not forget to describe the expected results based on this sample data.

 

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
Anonymous
Not applicable

Hi @v-diye-msft 

 

This is the PowerBI example to calculate this measure:

https://drive.google.com/file/d/1f5L54M0cj-c0wUJf5xFHmqkvWdx0JNA5/view?usp=sharing

 

The result expected is on the other reply.

 

Thanks

Anonymous
Not applicable

I created a pbix file. I need two measures:

  • The first measure is to calculate the number of new customers by month
    • Num_clientes_alta = DISTINCTCOUNT(Clientes[Cod_Cliente])
  • Te second measure is to calculate the number of customers by month whose "fecha_baja" is biggest (or null) than selected date and "fecha_alta" is less than selected date. With this measure the result expected is:
    • Num_Clientes = DISTINCTCOUNT(Clientes[Cod_Cliente])
MonthID201911201912202001202002202003
Num_Clientes 33444

 

ModelClientes.PNGTableClientes.PNGTableDate.PNGPBI.PNG

 
 
Greg_Deckler
Super User
Super User

First, Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Second, maybe: https://community.powerbi.com/t5/Quick-Measures-Gallery/Lookup-Min-Max/td-p/985814


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.