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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Madhans
Frequent Visitor

Running Total Issue with DAX in Power BI (No Direct Relationship Between Tables)

Hi everyone,

I’m working on a requirement to calculate the running total for the past 6 months in Power BI. I have a DAX measure called Average_Vessels and I need to calculate the running total for the previous month.

Here’s the issue:

  • When I calculate the running total using DatesInPeriod() in the VAR A or VAR B, the calculation works fine individually.
  • However, when I attempt to divide the result (as part of a more complex calculation), the running total does not behave as expected.

Key points:

  • There is no direct relationship between the IMO_MASTER_LIST table and the Calendar table in my model.
  • The error occurs only when performing the division part of the measure. When running only the calculation without division, the running total appears correct.

Questions:

  1. Can anyone suggest why the running total works when calculated separately but not after division?
  2. How can I resolve this issue given there’s no direct relationship between the IMO_MASTER_LIST and Calendar tables?
  3. Any suggestions on how to properly calculate the running total for the last 6 months in this scenario?

    Looking forward to your insights!


WhatsApp Image 2025-01-12 at 11.48.03 AM (1).jpegimage.pngWhatsApp Image 2025-01-12 at 11.48.03 AM.jpeg

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Madhans 

Based on your description, you can use crossfilter() function in your measure, you can try the following.

Measure =
CALCULATE (
    [Measure],
    CROSSFILTER ( IMO_MASTER_LIST[Column], VESSEL_OFFHIRE_HOUR_SMPL[Column], BOTH )
)

You can refer to the following link to know more about the crossfilter() function.

CROSSFILTER function - DAX | Microsoft Learn

 

Best Regards!

Yolo Zhu

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 @Madhans 

Based on your description, you can use crossfilter() function in your measure, you can try the following.

Measure =
CALCULATE (
    [Measure],
    CROSSFILTER ( IMO_MASTER_LIST[Column], VESSEL_OFFHIRE_HOUR_SMPL[Column], BOTH )
)

You can refer to the following link to know more about the crossfilter() function.

CROSSFILTER function - DAX | Microsoft Learn

 

Best Regards!

Yolo Zhu

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

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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