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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply

Problem with Understanding AllSELECTED

Source Data : WideWorldImportersDW-Full.bak 

As ALLSELECTED clears the implicit filter for visual it is used in only and keep explicit filter coming from slicer or other visuals.

 

Running Total (AllSELECTED ) Of Quantity = CALCULATE([Total Sales Quantity],
FILTER( ALLSELECTED('Dimension Date'),
MAX('Dimension Date'[Date])>='Dimension Date'[Date]
)
)

Its hard to understand why below code related to ALLSELECTED in above expression is not re initiating running total for selected calendar year label

ALLSELECTED('Dimension Date'[Date])

It seems like specifying Dimension Date table only and specific column provide all Dimension Date range for selected calender year and hence re-initiating running total.

If that is the case then how can we re-instate running total while using Calendar year label as slicer.


Thanks,
Harry

2 REPLIES 2
Nathaniel_C
Community Champion
Community Champion

Hi @HarsimranPWRBI ,

Try inserting a var and a return.  You need to capture that value outside of the CALCULATE. Also the test is less than or equal. You will have to put back in your table name and measure name.
Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel

Running Total (AllSELECTED ) Of Quantity =
VAR _ddate =
    MAX ( 'Calendar'[Date] )
RETURN
    CALCULATE (
        [Total Quantity],
        FILTER ( ALLSELECTED ( 'Calendar' ), 'Calendar'[Date] <= _ddate ) //Less than or equal to
    )


runtot.PNG

 

 





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

Proud to be a Super User!




Hi @Nathaniel_C ,

 

Thanks for the reply but this one is same expression shared in post without variable.

To be more specific,  i'm looking for alternate for ALLSELECTED(table) with ALLSELECTED(<column>,..) that can help me achieve same result.

Just to add more info, i'm using Date hierarchy in Visual and CY label as slicer & while using below code for measure in visual does not re-initiate running total for selected CY

Running Total (AllSELECTED Date) Of Quantity = 
CALCULATE([Total Sales Quantity],
 FILTER( ALLSELECTED('Dimension Date'[Date])
        ,MAX('Dimension Date'[Date])>='Dimension Date'[Date] 
        )
)

 

Thanks,

Harry

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.