Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Hexxa
New Member

DAX Calculation

Hi,

I have a Matrix Chart in as per the below picture i want to get the Grand sum from July till the selected month. Like if i selected the October it should give me the grand total from July to October of Qty - TransferOut  
which is a measure. but i write this DAX that is not working the result in column V5 it is still giving me the same current months Qty - TransferOut . 

 

Hexxa_0-1697009487057.png

 

3 REPLIES 3
Powerbi_Jockey
Frequent Visitor

Do you required running total until selected month?

v-yiruan-msft
Community Support
Community Support

Hi @Hexxa ,

First, please make sure that the fields which applied on the year and month slicers are not from the same table with the field [Qty - TransferOut]. And create a date dimension table if there is no this table in your model. DON'T create any relationship with the fact table. Then you can create a measure as below to get it.

Cumulative Total =
VAR SelectedYear =
    SELECTEDVALUE ( 'Date'[Year] )
VAR SelectedMonth =
    SELECTEDVALUE ( 'Date'[MonthNo] )
RETURN
    CALCULATE (
        SUM ( 'Table'[Qty - TransferOut] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            YEAR ( 'Table'[Date] ) = SelectedYear
                && MONTH ( 'Table'[Date] ) >= 7
                && MONTH ( 'Table'[Date] ) <= SelectedMonth
        )
    

In addition,  you can refer the following links to get it.

Solved: Cumulative total until the selected month - Microsoft Fabric 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.
lbendlin
Super User
Super User

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.