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

Column total and HASONEVALUE

Hi, 

I have this measure that is calculating the row total (per counterparty) based on another measure [P/L].   

 

celenius_1-1665409147186.png

However, the column total is wrong so how can I include the date dimension to the measure in order for the column total to add up correctly? (-5.748 - 5.031 - 3.168 - 38 -37 -38) = -14.660). Can also the date be included in the HASONEVALUE -function in some way? 

 

celenius_0-1665409117762.png

 

5 REPLIES 5
amitchandak
Super User
Super User

@Anonymous , remove if and hasonevalue code and just try sumx(Value(.....)  code

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

Hi @amitchandak ,

 

Apparently the HASONEVALUE was not needed, the row subtotals are correct with it removed, but the column subtotal is still wrong i.e I get the same result.

celenius_0-1665420691790.png

 

celenius_1-1665420722668.png

 

Anonymous
Not applicable

Hi @Anonymous ,

 

As far as I know, column subtotal is based on the column in Matrix column field (MonthName). So here I suggest you to add the whole table in SUMX().

Measure = SUMX(TransactionDaily,[P/L])

My Sample:

RicoZhou_0-1665469137824.png

P/L = MAX(TransactionDaily[Value])

If I use the measure as yours above, I will get same error in column subtotal. If I use mine, it works. Result is as below.

RicoZhou_1-1665469163648.png

 

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.

Anonymous
Not applicable

Hi @Anonymous , thanks for your input.

The measure [P/L] is calculated using values from two different tables.

As in this simplified example, volumes from one table and prices from another table.

celenius_0-1665492488504.png

 

Measure for the total   

celenius_1-1665492566340.png

P/L and P/L Total shows both wrong totals.

celenius_2-1665492764510.png

 

 

Anonymous
Not applicable

Apparently just adding the whole table in SUMX works in my simplified example, 

celenius_0-1665508251186.png

but when doing it in the real case I just receive a blank matrix with no values. 

 

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.