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
Hamdan1234
Helper III
Helper III

Last date of month sales based on slicer selection

Hello,

I was looking for last dates for each month sales based on selection of single sliicer. I serached and found out a video linked and picture are attached below where on single selection it shows last 6 months of slicer month sales. 

https://www.sqlbi.com/articles/show-previous-6-months-of-data-from-single-slicer-selection/

ssddff.PNG

but I want only last date sales for each month instead of whole month. For example when the user selects '2021-11-20', we want to see the dates of '2021-10-30', '2021-09-29', '2021-08-30' etc ...

Is it possible?

Kindly help.

Thanks

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @Hamdan1234 ;

You could create a another table then create a measure .

1.create a table as slicer, and don't create a relationship.

slicer = SUMMARIZE('Table',[Date],"year-month",FORMAT([Date],"mmmm yyyy"))

2.create a measure.

CumProduction =
CALCULATE (
    SUM ( 'Table'[Production] ),
    FILTER (
        ALLEXCEPT ( 'Table', 'Table'[Location] ),
        [Months Producing] <= MAX ( 'Table'[Months Producing] )
    )
)

The final output is shown below:

vyalanwumsft_0-1638168881400.png


Best Regards,
Community Support Team_ Yalan Wu
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

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi, @Hamdan1234 ;

You could create a another table then create a measure .

1.create a table as slicer, and don't create a relationship.

slicer = SUMMARIZE('Table',[Date],"year-month",FORMAT([Date],"mmmm yyyy"))

2.create a measure.

CumProduction =
CALCULATE (
    SUM ( 'Table'[Production] ),
    FILTER (
        ALLEXCEPT ( 'Table', 'Table'[Location] ),
        [Months Producing] <= MAX ( 'Table'[Months Producing] )
    )
)

The final output is shown below:

vyalanwumsft_0-1638168881400.png


Best Regards,
Community Support Team_ Yalan Wu
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

@Hamdan1234 , You can use closingbalancemonth or lastnonblank(values('Date'[Date]), [meausre])

 

refer

https://www.youtube.com/watch?v=yPQ9UV37LOU

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.