Forum Discussion

Jyaul1122's avatar
Jyaul1122
Helper III
2 years ago

Commulative with Month Slicer

Dear Helper,

 

i have two tables Calendar and Sales, i need to get sales amount Commulative and want display on Column chart.

Calendar table:

and Sales table:

 

Measures i wrote:  

Measure Sales =
var min_date=CALCULATE(MIN('Calendar'[Date]),ALL('Calendar'))
return
CALCULATE(SUM('Table'[Sales]),DATESBETWEEN('Calendar'[Date],min_date,MAX('Calendar'[Date])))
 
i have Month slicer and Column chart on my report.
Whenever i select slicer month May-2024, i want to get Column from May-2024 to Jan 2024.  
Whenever i select slicer month Apr-2024, i want to get Column from Apr-2024 to Jan 2024.  

 

 

Whenever i select slicer month March-2024, i want to get Column from March-2024 to Jan 2024.  
Whenever i select slicer month Feb-2024, i want to get Column from Feb-2024 to Jan 2024.  and so.
 
How can i achive this.
                 

 

6 Replies

  • Have you considered using the Quick Measures?  There the pattern is called "Running Total"

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi lbendlin ,

    Thanks for your quick response.

    Hi Jyaul1122 ,

    Please refer to my pbix file to see if it helps you.

    Create a measure.

    MeasureSales =
    VAR _1 =
        CALCULATE (
            SUM ( 'Table'[Sales] ),
            FILTER (
                ALL ( 'Table' ),
                'Table'[Date] <= SELECTEDVALUE ( 'Calendar'[Date] )
                    && 'Table'[Date] <= SELECTEDVALUE ( 'Table'[Date] )
            )
        )
    VAR _2 =
        SELECTEDVALUE ( 'Calendar'[Date] )
    RETURN
        IF ( _2 >= MAX ( 'Table'[Date] ), _1, BLANK () )
    

     

    How to Get Your Question Answered Quickly - Microsoft Fabric Community

     

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

     

    Best Regards
    Community Support Team _ Rongtie

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

     

     

     

     

     

    • Jyaul1122's avatar
      Jyaul1122
      Helper III

      Anonymous 

       

      Thanks for your effort and help. You are using Table[Date],Table[Sales],MeasureSales in table visual.

      Actually in my PBIX those type of visual using data from multiple table related with Calendar table. So that i would like have visual with data: Calendar[Date],Table[Sales],MeasureSales. 

       

      Hope understand my requirements.

       

       

      Thanks.