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.
Hi,
i created a calculated table called Table1 using DAX with 3 columns (Claim Id, LocationKey, and Calendar Date). Now what i want to do is use that calculated table as a context when calling a measure called GrossReserveAmt and return all 3 columns from the calculated table and the GrossReserveAmt calculated for each row from the table. I tried to use summarize, but i can't get to teh columns of the table and it just gives me the total amount of the GrossReserveAmt measure.
thanks
Scott
measures return a scalar value - always. You can use table variables during the computation of the measure, but the end result has to be a scalar.
Rethink your process. Use CONCATENATEX() if you must.
Ok, so if i create a calculated table using the same logic and then create a calculated column to call the meausure for each row. RIght now it's returning the total value for each row. How do i change the context when calling the measure so that it uses the row context (claim id, location id, and date) when calculating the measure?
@scabral , what is the requirement behind the requirement? Perhaps the approach should be different.
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!
Hi Stevedep,
i tried a couple of different ways to accomplish this, but basically i created a measure that accepts a date (AsOfDt) and the measure gets the latest version of a reserve for each claim/damage/location where the reserve date is <= the AsOfDate. So let's call that measure GrossClaimReserve. Here is the actual code for the measure:
VAR AsOfDtId =
MAX ( 'As Of Date'[Dim Date Identifier] )
VAR ReserveMaxFilter =
CALCULATETABLE (
ADDCOLUMNS (
SUMMARIZE (
'Claim Reserve Values',
'Claim Reserve Values'[Claim ID],
'Claim Reserve Values'[Damage ID],
'Claim Reserve Values'[Location ID]
),
"SeqNum", CALCULATE ( MAX ( 'Claim Reserve Values'[Reserve Sequence Num] ) )
),
KEEPFILTERS ( 'Claim Reserve'[Reserve Status ID] = 2 ),
'Claim Reserve Values'[Reserve Date ID] <= AsOfDtId
)
RETURN
CALCULATE (
SUM ( 'Claim Reserve Values'[100 % Gross Amount USD] ),
TREATAS (
ReserveMaxFilter,
'Claim Reserve Values'[Claim ID],
'Claim Reserve Values'[Damage ID],
'Claim Reserve Values'[Location ID],
'Claim Reserve Values'[Reserve Sequence Num]
),
'Claim Reserve'[Reserve Group ID]
IN { 1000007, 1000008 }
)
this measure works and i can call this measure using the following code and it gives me the latest reserve for each claim/damage/location for the min AsOfDt in context:
Whats is the business requirement?
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!
i also tried to just use AddColumns to call the measure for the table liek this:
VAR accuracy =
ADDCOLUMNS(
reserveValueDatesToAsOfLineage,
"ReserveAmt", [NewGrossClaimsReserveUSD]
)
return accuracy
but i get a memory error.
HI Stevedep,
The requiremnt is to figure out what the total reserve amount is for each claim at a specified point in time (the AsOfDt). Then compare that reserve amount to the actual payment amount of the claim (which i have not included yet) to see what the percentage is between both. the first step is to get the latest reserve amount for each claim based on the asofdt so that is what i am trying to figure out here. Once i get that, i can bring in the payment amount and do the division to get the percentage.
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 |
---|---|
21 | |
7 | |
6 | |
5 | |
5 |
User | Count |
---|---|
27 | |
10 | |
10 | |
9 | |
6 |