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
non23
Helper I
Helper I

Measure wont appear when multiplying rolling average to fixed number

I would like to multiply the 2nd table to kilos base on it's category. Unfortunately, since 11/07/2025 orginally doesn't have a data it won't show the kg convertion. 

 

Current measure that I have is:

Measure = CALCULATE(SUMX(Sales,[2-Day Rolling Average]*RELATED('Weight'[KG])))
Current relationship is based on the category of Table1 and Table2
 
Hoping to show 4800 as well for 11/07/2025 on the third table and the 14/07/2025 data as well.
 

2025-07-10_10-39-11.png

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @non23 

 

That’s likely because the category refers to a row that doesn’t exist. For example, on November 7, a specific category might not have an entry in your data. So while the rolling average returns a value, there’s no corresponding value for the conversion factor.

 

A more reliable approach would be to use dimension tables—one for dates and one for categories. The date dimension should contain all dates without gaps. Then, base your calculations on those dimension tables using the relevant columns. Examples:

Rolling Avg Sales =
CALCULATE (
    AVERAGEX ( VALUES ( Dates[Date] ), [Sum of Sales] ),
    DATESINPERIOD ( Dates[Date], MAX ( Dates[Date] ), -2, DAY ),
    REMOVEFILTERS ( Dates ) --- not necessary if Dates have been marked as date table.
)
Rolling Avg Sales Converted =
SUMX (
    SUMMARIZECOLUMNS (
        Dates[Date],
        ConversionFactor[Category],
        "@converted", [Rolling Avg Sales] * CALCULATE ( SUM ( ConversionFactor[ConversionFactor] ) )
    ),
    [@converted]
)

You can see in the sc reenshot below that as long as rolling average has a value, so does the converted.

danextian_0-1752121070893.png

Please see the attached pbix.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

1 REPLY 1
danextian
Super User
Super User

Hi @non23 

 

That’s likely because the category refers to a row that doesn’t exist. For example, on November 7, a specific category might not have an entry in your data. So while the rolling average returns a value, there’s no corresponding value for the conversion factor.

 

A more reliable approach would be to use dimension tables—one for dates and one for categories. The date dimension should contain all dates without gaps. Then, base your calculations on those dimension tables using the relevant columns. Examples:

Rolling Avg Sales =
CALCULATE (
    AVERAGEX ( VALUES ( Dates[Date] ), [Sum of Sales] ),
    DATESINPERIOD ( Dates[Date], MAX ( Dates[Date] ), -2, DAY ),
    REMOVEFILTERS ( Dates ) --- not necessary if Dates have been marked as date table.
)
Rolling Avg Sales Converted =
SUMX (
    SUMMARIZECOLUMNS (
        Dates[Date],
        ConversionFactor[Category],
        "@converted", [Rolling Avg Sales] * CALCULATE ( SUM ( ConversionFactor[ConversionFactor] ) )
    ),
    [@converted]
)

You can see in the sc reenshot below that as long as rolling average has a value, so does the converted.

danextian_0-1752121070893.png

Please see the attached pbix.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

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.