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
lasmithfla
Helper I
Helper I

Repeat a value daily that only occurs monthly

Posted better example of my data and output needed.

 

Need some help getting a dax calc to have a monthly value repeat daily - I'm not able to attach a file but this is an example of what the data the looks like.  The calc that I wrote is giving me the total of the count instead of the repeating the count.

So in the first line the count should be 857 and Count repeated dialy should also be 857 until you get to 6/1. Then it should update based on those values.

 

I've hid some of the dates below to save space but basically every day would show.

 

I do not want to create another table if possible repeating these values; we have years worth of data.

 

This is what I have written so far that is the 3rd column in the pasted data below.

Count Repeated Daily' = VAR _Weekly = Max('calendar'[StartingDayofMonth])
Return
Calculate (Sum(tableName[Count]),AllSelected('Calendar'[Date]))

DateCountCount Repeated Daily
5/1/20238571709
5/2/2023 1709
5/3/2023 1709
5/4/2023 1709
5/5/2023 1709
5/6/2023 1709
5/7/2023 1709
5/22/2023 1709
5/28/2023 1709
5/29/2023 1709
5/30/2023 1709
5/31/2023 1709
6/1/20238521709
6/2/2023 1709
6/3/2023 1709
6/4/2023 1709
6/5/2023 1709
6/6/2023 1709
6/7/2023 1709
6/8/2023 1709
6/9/2023 1709
6/10/2023 1709
1 ACCEPTED SOLUTION

Hi @lasmithfla ,

I created a sample pbix file(see the attachment), please check if that is what you want.

Count = 
VAR _seldate =
    SELECTEDVALUE ( 'Calendar'[Date] )
RETURN
    CALCULATE (
        SUM ( 'HC'[Value] ),
        FILTER (
            'HC',
            'HC'[Date] >= DATE ( YEAR ( _seldate ), MONTH ( _seldate ), 1 )
                && 'HC'[Date] <= EOMONTH ( _seldate, 0 )
        )
    )

vyiruanmsft_0-1691735619199.png

Best Regards

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

5 REPLIES 5
lasmithfla
Helper I
Helper I

HC table date field is Date and only have data for 1st of the month
5/1/2023857  
6/1/2023852  
7/1/2023906  
    
    
I need these values to repeat for the each day of the month
From Calendar TableFrom HC TableDesired output with DAX
DateCountCount Repeated Daily
05/01/23857857
05/02/23 857
05/03/23 857
05/04/23 857
05/05/23 857
05/06/23 857
05/07/23 857
05/27/23 857
05/28/23 857
05/29/23 857
05/30/23 857
05/31/23 857
06/01/23852852
06/02/23 852
06/03/23 852
06/04/23 852
06/05/23 852
06/06/23 852
06/07/23 852
06/08/23 852
06/09/23 852
06/10/23 852
06/11/23 852
06/12/23 852
06/13/23 852
06/27/23 852
06/28/23 852
06/29/23 852
06/30/23 852
07/01/23906906
07/02/23 906
07/03/23 906

Hi @lasmithfla ,

I created a sample pbix file(see the attachment), please check if that is what you want.

Count = 
VAR _seldate =
    SELECTEDVALUE ( 'Calendar'[Date] )
RETURN
    CALCULATE (
        SUM ( 'HC'[Value] ),
        FILTER (
            'HC',
            'HC'[Date] >= DATE ( YEAR ( _seldate ), MONTH ( _seldate ), 1 )
                && 'HC'[Date] <= EOMONTH ( _seldate, 0 )
        )
    )

vyiruanmsft_0-1691735619199.png

Best Regards

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.
danextian
Super User
Super User

Hi @lasmithfla ,

 

It seems that what you're trying to achieve is a running sum. If so, try the calculated column below:

Rpeating Value = 
CALCULATE (
    SUM ( 'Table'[Count] ),
    FILTER ( 'Table', 'Table'[Date] <= EARLIER ( 'Table'[Date] ) )
)

danextian_0-1691555170862.png

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

The Repeating Value is the answer I'm looking for but my date is in a different column so it wouldn't let me enter that after the "EARLIER" when trying to create a calc. column.  My computer died and just getting reconnected, I will try and put together sample data, I'm not allowed to upload PBIX file using the allowed methods.

v-yiruan-msft
Community Support
Community Support

Hi @lasmithfla ,

Do you want to get the count of repeated items per month? Could you please provide some raw data in your table with Text format and your expected result with calculation logic and special examples? It would be helpful to find out the solution. You can refer the following link to share the required info:

How to provide sample data in the Power BI Forum

 

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

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.

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.