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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Not able to get totals in Power BI

I want to understand, why I am not getting totals in some senarios in the table. Why does this happen and what I must do to avoid this?

The measures I used are:

1.

0_Last week Cost of Freight =
VAR CurrentWeek = SELECTEDVALUE('dDate'[Week No.])
VAR CurrentYear = SELECTEDVALUE('dDate'[Year])
VAR MaxWeekNumber = CALCULATE(MAX('dDate'[Week No.]),ALL('dDate'))

RETURN

CALCULATE([Cost of Freight],FILTER(ALL('dDate'),IF(CurrentWeek=1,
'dDate'[Week No.] = MaxWeekNumber && 'dDate'[Year] = CurrentYear-1,
'dDate'[Week No.] = CurrentWeek-1 && 'dDate'[Year] = CurrentYear))
)
2. Cost of Freight = SUM('fKPI 2019'[Load Charge])
3. 0_Weekly change of cost = [Cost of Freight]-[0_Last week Cost of Freight]

Totals not showingTotals not showingTotals Showing_2.PNG
Totals is showingTotals is showing

1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

Hi @Anonymous 

In the Total row there are no filters applied. Your SELECTEDVALUE expressions will thus return blank, since there is more than one value in the specified column (see https://dax.guide/selectedvalue/  )

You will either have to update the code of the meausures to take this into account or create another one based on what you have. This is assuming you have  'dDate'[Week No.] and 'dDate'[Year] in the rows of your visual:

0_Last week Cost of Freight_TOTAL =
SUMX(SUMMARIZE('dDate', 'dDate'[Week No.], 'dDate'[Year]), [0_Last week Cost of Freight])

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

 Cheers 

SU18_powerbi_badge

View solution in original post

3 REPLIES 3
AlB
Community Champion
Community Champion

Hi @Anonymous 

In the Total row there are no filters applied. Your SELECTEDVALUE expressions will thus return blank, since there is more than one value in the specified column (see https://dax.guide/selectedvalue/  )

You will either have to update the code of the meausures to take this into account or create another one based on what you have. This is assuming you have  'dDate'[Week No.] and 'dDate'[Year] in the rows of your visual:

0_Last week Cost of Freight_TOTAL =
SUMX(SUMMARIZE('dDate', 'dDate'[Week No.], 'dDate'[Year]), [0_Last week Cost of Freight])

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

 Cheers 

SU18_powerbi_badge

Anonymous
Not applicable

@AlB 

The same problem still exist while using a different formula, I want to understand why does this happen.

 

1. _Loadability by cases per trips =
CALCULATE(
DIVIDE([0_Total Volume Shipped by Cases],[0_Total Shipments],BLANK())

)

2. last month loadability BCPT =

CALCULATE(

[ _Loadability by cases per trips ],DATEADD(dDate[Date],-1,MONTH))

3. Trips saved VS last Month =

CALCULATE(
IF([last month loadability BCPT]=0,BLANK(),
CALCULATE(
(DIVIDE
([0_Total Volume Shipped by Cases],[last month loadability BCPT],BLANK())-[0_Total Shipments])

)))

 

Totals Not Showing.2.PNG

Anonymous
Not applicable

@AlBThank you, It worked.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.