Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I am having an issue where the rows in my table visual are showing correct values but the total row is wrong. I assume its related to context transition but I'm not sure. Here is a basic version of my measure along with a screenshot of a basic example of tables and desired result. Any advice is highly appreciated. Thanks
MeasureName =
VAR stdt =
IF (
SELECTEDVALUE ( DateTable[YearStartDate] )
<= SELECTEDVALUE ( PropertyInfoTable[PurchaseDate] ),
SELECTEDVALUE ( DateTable[YearStartDate]),
SELECTEDVALUE ( DateTable[YearStartDate])
)
VAR endt =
IF (
SELECTEDVALUE ( PropertyInfoTable[SellDate]) = BLANK (),
SELECTEDVALUE ( DateTable[Date] ),
SELECTEDVALUE ( PropertyInfoTable[SellDate])
)
RETURN
SUMX (
SUMMARIZE (
PropertyInfoTable,
PropertyInfoTable[Name]
),
CALCULATE (
SUM ( ActualCostsTable[Amount] ),
DATESBETWEEN ( DateTable[Date], stdt, endt )
)
)
You can try below measure:
MeasureName =
SUMX(VALUES(PropertyInfoTable[Name]),CALCULATE(
VAR stdt =
IF (
SELECTEDVALUE ( DateTable[YearStartDate] )
<= SELECTEDVALUE ( PropertyInfoTable[PurchaseDate] ),
SELECTEDVALUE ( DateTable[YearStartDate]),
SELECTEDVALUE ( DateTable[YearStartDate])
)
VAR endt =
IF (
SELECTEDVALUE ( PropertyInfoTable[SellDate]) = BLANK (),
SELECTEDVALUE ( DateTable[Date] ),
SELECTEDVALUE ( PropertyInfoTable[SellDate])
)
RETURN
SUMX (
SUMMARIZE (
PropertyInfoTable,
PropertyInfoTable[Name]
),
CALCULATE (
SUM ( ActualCostsTable[Amount] ),
DATESBETWEEN ( DateTable[Date], stdt, endt )
)
)
)
)
Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !
Thank you~
I was able to create a measure containing the initial start date and end date variables/parameter in an measure called "TotalActualCostsTableAmount" and then put it inside the following measure .
SUMX (
SUMMARIZE (
PropertyInfoTable,
PropertyInfoTable[Name]
),
CALCULATE (
[TotalActualCostsTableAmt],
DATESYTD ( 'DateTable'[Date] )
)
)
My question is, are there any other more efficient ways of writing this measure that doesn't require SUMX(Summarize. I'm still confused as to why if don't wrap in a SUMX(Summarize and I select a single property the row and total are correct but if I select two or more properties the total get the date logic wrong.
@IM_TRYING_HERE First, please vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e
This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907
Also: https://youtu.be/uXRriTN0cfY
And: https://youtu.be/n4TYhF2ARe8
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
19 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
25 | |
10 | |
10 | |
9 | |
6 |