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

Start date vs End Date

Hi everyone, 

 

Can you please help me with a measure that calculates using the following logic?

 

Ex11.png

 

 

 

 

 

 

 

 

 

 

 

I dont necessary needs a specific month as the example, Id like to show the data in a Table using the months/quarters/years from a Calendar Table where I can see the % of projects that starts in one month and ends in another one!

 

Thank you!

 

 

1 ACCEPTED SOLUTION
yingyinr
Community Support
Community Support

Hi @chdelgado ,

You can create a measure as below:

Measure = 
VAR _cursdate=MAX('Table'[Fecha Inicio])
VAR _startinsmonth= CALCULATE(DISTINCTCOUNT('Table'[ID Actividad]),FILTER('Table', MONTH('Table'[Fecha Inicio])=MONTH(_cursdate)))
VAR _startendnotinsmonth = CALCULATE(DISTINCTCOUNT('Table'[ID Actividad]),FILTER('Table', MONTH('Table'[Fecha Inicio])=MONTH(_cursdate)&&MONTH('Table'[Fecha Fin])<>MONTH(_cursdate)))
RETURN 
DIVIDE(_startendnotinsmonth,_startinsmonth)

Start date vs End Date.JPG

Best Regards
Community Support Team _ Rena Ruan
If this post helps, then please consider Accept it as the solution to help the other members find it more.

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

View solution in original post

3 REPLIES 3
yingyinr
Community Support
Community Support

Hi @chdelgado ,

You can create a measure as below:

Measure = 
VAR _cursdate=MAX('Table'[Fecha Inicio])
VAR _startinsmonth= CALCULATE(DISTINCTCOUNT('Table'[ID Actividad]),FILTER('Table', MONTH('Table'[Fecha Inicio])=MONTH(_cursdate)))
VAR _startendnotinsmonth = CALCULATE(DISTINCTCOUNT('Table'[ID Actividad]),FILTER('Table', MONTH('Table'[Fecha Inicio])=MONTH(_cursdate)&&MONTH('Table'[Fecha Fin])<>MONTH(_cursdate)))
RETURN 
DIVIDE(_startendnotinsmonth,_startinsmonth)

Start date vs End Date.JPG

Best Regards
Community Support Team _ Rena Ruan
If this post helps, then please consider Accept it as the solution to help the other members find it more.

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

View solution in original post

amitchandak
Super User IV
Super User IV

@chdelgado , Try measures like

 

% ended in same Month = divide(countx(filter(Table, eomonth([start date],0)= eomonth([end date],0)),Table[Task]), count(Table[Task]))


% ended in different Month = divide(countx(filter(Table, eomonth([start date],0)= eomonth([end date],0)),Table[Task]), count(Table[Task]))



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

I tried with your measures and worked in some way, now it is giving me the right result, however if I list the tasks on a table, it is not showing me the ones that were not completed the same month, only the ones that did.

This is the data model, maybe you can have a better idea with this

https://1drv.ms/x/s!Ag7DnkvMsR95szrMjdViLqwnK5NT?e=FQZdMw

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

April Update

Check it Out!

Click here to read more about the April 2021 Updates!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

secondImage

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.