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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Measure not showing value for all dates in table visual

I am calculating a measure for getting the cumulative total of a column before a date but it only shows the total for some dates, although that total is correct for all the dates the total is showing up. 

To explain -  

The data tables I have is - 
PRE DR - 

BP-depot Order valid till Date loss quantity
120-09-202020
121-09-202010
123-09-202025
124-09-202025

 

In transit - 

BP_Depotexpected date of reachingQuanity in shipment
120-09-202025
121-09-20200
122-09-202040
124-09-202015

 

The BP_Depot column can be thought of as the key column - 

I have made a date table and done the following relationships - 

 

powerbihelp1245_0-1600940983681.png

 

@amitchandak I had missed adding the above image, hope it will help in solving

 

 

In Transit Running Total = 
VAR LastVisibleDate =
    SELECTEDVALUE(dates[Date])
VAR FirstVisibleDate =
    MIN ( transit[expected date of reaching] )
VAR LastDateWithorder =
    CALCULATE (
        MAX ( PreDR[Order valid till Date] ),
        REMOVEFILTERS ()   
    )
VAR Result =
    IF (
        FirstVisibleDate<= LastDateWithorder,
        CALCULATE (
            SUM(transit[Quanity in shipment]),
            transit[expected date of reaching] <= LastVisibleDate 
        )
    )
RETURN
    Result

 

 

 

 

 

My resultant table visual looks like this - 
image.png

 
For the date 22-09-20 also it should show 65 as if you see the transit table 40 quanity is reaching on 22nd.

 

I need this because I am doing some other measure calculations based on this measure which requires a value for this date for this cumulative total measure.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous 

The reason caused your problem may be that there isn't any relationship between Date Table and transit table. 

I think you can change your relationship as below.

1.png

And build a measure:

 

In Transit Running Total = 
SUMX(FILTER(ALL(transit),transit[expected date of reaching]<=MAX('Date'[Date])),transit[Quanity in shipment])

 

Result:

2.png

Or you can keep (both direction)relationships between PreDR,Key and transit, and remove relaionships between Data Table with them. Build loss quantity by measure, and In Transit Running Total Measure will show correctly as well.

 

Best Regards,

Rico Zhou

 

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

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.

 

Best Regards,

Rico Zhou

amitchandak
Super User
Super User

@Anonymous , with cumulative, with date table, try a formula like. Join both dates with date table and try like example

 

 

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(date,date[date] <=maxx(date,date[date])))

or

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(allselected(date),date[date] <=maxx(date,date[date])))

 

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(all(date),date[date] <=maxx(date,date[date])))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak  See the following results I get with your 3 measures - 

image.png

 
code for these measures as suggested by you - 

total in transit 1 = CALCULATE(SUM(transit[Quanity in shipment]),filter(dates,dates[Date] <=maxx(dates,dates[Date])))

 

total in transit 2 = CALCULATE(SUM(transit[Quanity in shipment]),filter(ALLSELECTED(dates),dates[Date] <=maxx(dates,dates[Date])))
total in transit 3 = CALCULATE(SUM(transit[Quanity in shipment]),filter(ALL(dates),dates[Date] <=maxx(dates,dates[Date])))


The values still don't show for 22nd, the cumulative total is wrong as well. 

Anonymous
Not applicable

Hi @Anonymous 

The reason caused your problem may be that there isn't any relationship between Date Table and transit table. 

I think you can change your relationship as below.

1.png

And build a measure:

 

In Transit Running Total = 
SUMX(FILTER(ALL(transit),transit[expected date of reaching]<=MAX('Date'[Date])),transit[Quanity in shipment])

 

Result:

2.png

Or you can keep (both direction)relationships between PreDR,Key and transit, and remove relaionships between Data Table with them. Build loss quantity by measure, and In Transit Running Total Measure will show correctly as well.

 

Best Regards,

Rico Zhou

 

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

 

 

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors