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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
ashmitp869
Post Partisan
Post Partisan

dax expression help need to get the sum until the date and month selected ?

Hi,

 

Need help with the dax query:

Selection in report :

ashmitp869_0-1711065308676.png

I need to calucate the value until the Year and Month Name selected in the filter panel. (i.e <=)

 

Trying the dax : 

PTD - Billed(Ex-GST) = CALCULATE([Revenue Amount] ,
                         FILTER(SM,SM[Service Group Level 0] ="REVENUE"),
                         FILTER('Date','Date'[Year] <=SELECTEDVALUE('Date'[Year]) && 'Date'[Month] <= SELECTEDVALUE('Date'[Month])
                         )
                     
                       )
 
 
Another :
PTD1 - Billed(Ex-GST) = CALCULATE([Revenue Amount] ,
                         FILTER(SM,SM[Service Group Level 0] ="REVENUE"),
                         FILTER('Date','Date'[Date] <= Max(vFactBudgetActuals[Transaction Date]))
                        ,ALL('Date'[Year],'Date'[Month Name])
                         )
 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ashmitp869 ,

Please try the following methods and check if they can solve your problem:

1.Create the sample Table.

vjiewumsft_0-1711071858880.png

2.Drag the year, month and Service Group into the three slicer visuals.

vjiewumsft_1-1711071900682.png

3.Create the new measure to calculate filtered Date.

 

SUM_selected = 
VAR sm_sel = SELECTEDVALUE(SM[Service Group Level 0])
var total_sel = CALCULATE (
        SUM ('Table'[Revenue]),
        FILTER (
            ALL ('Table'),
            'Table'[Year] < SELECTEDVALUE('Table'[Year]) || ('Table'[Year] = SELECTEDVALUE('Table'[Year]))
                && 'Table'[Month] <= SELECTEDVALUE('Table'[Month])
        )
    )
RETURN
IF(sm_sel = "Revenue", total_sel ,BLANK())

 

4.Drag the measure into the card visual.

vjiewumsft_2-1711071933046.png

5.Select the Year and month in the slicer visual. The result is shown below.

vjiewumsft_3-1711071939546.png

Best Regards,

Wisdom 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

1 REPLY 1
Anonymous
Not applicable

Hi @ashmitp869 ,

Please try the following methods and check if they can solve your problem:

1.Create the sample Table.

vjiewumsft_0-1711071858880.png

2.Drag the year, month and Service Group into the three slicer visuals.

vjiewumsft_1-1711071900682.png

3.Create the new measure to calculate filtered Date.

 

SUM_selected = 
VAR sm_sel = SELECTEDVALUE(SM[Service Group Level 0])
var total_sel = CALCULATE (
        SUM ('Table'[Revenue]),
        FILTER (
            ALL ('Table'),
            'Table'[Year] < SELECTEDVALUE('Table'[Year]) || ('Table'[Year] = SELECTEDVALUE('Table'[Year]))
                && 'Table'[Month] <= SELECTEDVALUE('Table'[Month])
        )
    )
RETURN
IF(sm_sel = "Revenue", total_sel ,BLANK())

 

4.Drag the measure into the card visual.

vjiewumsft_2-1711071933046.png

5.Select the Year and month in the slicer visual. The result is shown below.

vjiewumsft_3-1711071939546.png

Best Regards,

Wisdom Wu

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.