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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Khomotjo
Helper II
Helper II

Measure Adding

Hello Everyone,

 

Has anyone ever experienced a scenario where a measure adds up( or multiplies) for prior dates. I have the following measure : The measure multplies the numbers for each prior date. i.e for the 14th the no should be 167 but it is 167*2 which gives 334. Similarly for the 12th the no should be 169 but is actually 169*3 =507.

 

This is my measure:

 

Picked_Lines = VAR Analyse = MAX(Orders[Date])
RETURN
    CALCULATE(
     SUM(Orders[Product Count]),
        FILTER(ALL(Orders),(TRUNC(Orders[Finalised Date])=Analyse)
)
)
 
 
 
Khomotjo_0-1739973613015.png

 

1 ACCEPTED SOLUTION
DataNinja777
Super User
Super User

Hi @Khomotjo ,

 

The issue with your measure arises because FILTER(ALL(Orders), (TRUNC(Orders[Finalised Date])=Analyse)) removes all filters from the table, causing unintended cumulative calculations across prior dates. The ALL(Orders) function removes any filters applied, leading to an incorrect multiplication effect.

To fix this, replace ALL(Orders) with ALLSELECTED(Orders), which retains the relevant filters while applying the condition correctly. This ensures that the measure calculates SUM(Orders[Product Count]) only for the intended Finalised Date without accumulating values across prior dates.

Picked_Lines =
VAR Analyse = MAX(Orders[Date])
RETURN
    CALCULATE(
        SUM(Orders[Product Count]),
        FILTER(ALLSELECTED(Orders), TRUNC(Orders[Finalised Date]) = Analyse)
    )
)

By making this change, the measure will now properly return the expected values without multiplying them across previous dates. If the issue persists, consider checking if any additional filters or relationships in your data model are affecting the results.

 

Best regards,

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

HI @Khomotjo,

Any update on this? Did DataNinja777 's suggestion helps for your scenario?

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

Hi @Khomotjo ,

Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.

If these also don't help, please share more detailed information and description to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

DataNinja777
Super User
Super User

Hi @Khomotjo ,

 

The issue with your measure arises because FILTER(ALL(Orders), (TRUNC(Orders[Finalised Date])=Analyse)) removes all filters from the table, causing unintended cumulative calculations across prior dates. The ALL(Orders) function removes any filters applied, leading to an incorrect multiplication effect.

To fix this, replace ALL(Orders) with ALLSELECTED(Orders), which retains the relevant filters while applying the condition correctly. This ensures that the measure calculates SUM(Orders[Product Count]) only for the intended Finalised Date without accumulating values across prior dates.

Picked_Lines =
VAR Analyse = MAX(Orders[Date])
RETURN
    CALCULATE(
        SUM(Orders[Product Count]),
        FILTER(ALLSELECTED(Orders), TRUNC(Orders[Finalised Date]) = Analyse)
    )
)

By making this change, the measure will now properly return the expected values without multiplying them across previous dates. If the issue persists, consider checking if any additional filters or relationships in your data model are affecting the results.

 

Best regards,

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.