i have the below measure:
Hi @CJKPowerBI ,
Has your problem been solved? If solved, please consider Accept it as the solution to help the other members find it more quickly.
Create a Calendar Table with a relationship (Many to One and Single) from the Date column of the Data Table to the Date column of the Calendar Table. Write these measures
Bal = SUM('Table'[Amount])
Farthest date = max('Table'[Date])
Bal latest = calculate([Bal],datesbetween(calendar[date],[Farthest date],[Farthest date]),'Table'[Type]="Balance")
Hope this helps.
Measure = VAR __Max_Date = MAX('Table'[Date]) VAR __Table = FILTER(ALLSELECTED('Table'),[Date] = __Max_Date && [Type] = "Balance") RETURN SUMX(__Table, [Amount])
@CJKPowerBI It is quite likely that you are unintentionally withholding critical information. Please see the PBIX attached below signature. You want Table 4 and Measure 4 in that table. Works.
@Greg_Deckler thank you for sending the .pbix but still didnt work with my data... indeed i have more columns which are not in the measure but maybe they create the issue...
my data is in an excel and as below if i have no filters at all so based on the measure it should show the sum of all column Amount correct?
@CJKPowerBI Here is an updated PBIX (below signature) with an your new sample data. As you ucan see in the Card visual you get the correct value $65,533. I also added a Measure 5 so that you can see exactly which rows are being included in that calculation (not all rows, just rows with the most recent date as you originally specified. Is the problem that you aren't getting the $65,533 number in some other visualization that you have? Perhaps this version will work for you although I would really need to know the visualization being used and its configuration:
Measure 6 = VAR __Max_Date = MAXX(ALL('Table4'),[Date]) VAR __Table = FILTER(ALL('Table4'),[Date] = __Max_Date && [Type] = "Balance") RETURN SUMX(__Table, [Amount])
You can see how the two measures work differently in the Table visual.
Finally, just from your description, I wonder if perhaps you are running afoul of AutoExist where you are filtering on two or more columns in the same table and autoexist is removing all of the rows it doesn't think should be calculated.