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
rodrigo09062015
Frequent Visitor

add value of the first and last day of my table

Hi,
I have a historical table that takes a picture of my database every day.
I need to take two measurements.
1. Create a measure to add a certain field, as long as the date is the first day of the month registered in the table.
2. Create the same measurement above for the last day of the month recorded in the table.

Suppose that for January the first day with record is January 2, 2022, it must take that date into account.

suppose the last day of registration is January 5th, 2022, it will be this date that he should consider.

4 REPLIES 4
Icey
Community Support
Community Support

Hi @rodrigo09062015 ,

 

Do you mean that you want to do something like below?

 

1. find the first and last day with record in current month;

2. filter data between the first and last day calculated in stpe 1;

3. screenshot

 

If so, could you share us more details? For example, some sample data and your desired result.

 

Reference: 

How to Get Your Question Answered Quickly - Microsoft Power BI Community

How to provide sample data in the Power BI Forum - Microsoft Power BI Community

 

 

Best Regards,

Icey

 

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

Hi,
exactly.

follows link with fictitious data, but the way I have to treat my data

 

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

Hi @rodrigo09062015 ,

 

Is this what you want?

DISTINCTCOUNT = 
VAR FirstDay_ =
    CALCULATE (
        MIN ( amostra[photo date] ),
        ALLEXCEPT ( amostra, amostra[período (month & year)] )
    )
RETURN
    CALCULATE ( DISTINCTCOUNT ( amostra[Status] ), amostra[photo date] = FirstDay_ )
COUNT = 
VAR FirstDay_ =
    CALCULATE (
        MIN ( amostra[photo date] ),
        ALLEXCEPT ( amostra, amostra[período (month & year)] )
    )
RETURN
    CALCULATE ( COUNT ( amostra[Status] ), amostra[photo date] = FirstDay_ )

Icey_0-1642572197106.png

 

 

Best Regards,

Icey

 

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

amitchandak
Super User
Super User

@rodrigo09062015 ,The information you have provided is not making the problem clear to me. Can you please explain with an example.
If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Appreciate your Kudos.

 

But these two blogs can help

 

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-o...

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.