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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
vickyprudhvi
Helper IV
Helper IV

Help with a measure using dates

Hi

I have 3 tables

Date                                         ClaimRoot                         WCCSnapshot

DateID                                        ClaimID                               WCCID

CalendarDate                            ReportedDateID                     ClaimID

                                                  ClaimNumber                        AsofDate

                                                   ClaimAmt

 

I am planning to write a measure which takes in date from asofDate and calculate whole ClaimAmt for the reportedyear

For example

ASofDate 04/31/2016 then ClaimAmt should be calculated for ReportedDate 04/31/2015 to 04/31/206.

I wrote a measure as below

CALCULATE(      Sum( [ClaimAMT)FILTER(Date,
Date[CalendarDate]>=Max(WCCSnapshot[AsofDateStart])&& Date<=Max(WCSnapshot[AsofDate])))

 

I wrote a calculated colm in WCCSnapshot for previous year date AsofDateStart

this measure give me error saying . The Expression refers to multiple columns. Multiple columns cannot be converted into scalar value

 

Please help me with this

 

Thank you all

 

3 REPLIES 3
v-caliao-msft
Employee
Employee

Hi Vicky,

 

According to your description, you need to calculated the total ClaimAmt for ReportDate from to previous year to the AsofDate, right?

 

If that is the case, please add a calculated column in Date table
PreviousYear = DATEADD('Date'[CalendarDate],-1,YEAR)

 

Then add a calculated column in WCCSnapshot table
PreviousYearDate = LOOKUPVALUE('Date'[PreviousYear],'Date'[CalendarDate],WCCSnapshot[AsofDate])

 

Then you can calcualte total ClaimAmt use the DAX expression below.
= CALCULATE(SUM(ClaimRoot[ClaimAmt]),FILTER(ClaimRoot,ClaimRoot[ReportDateID]>=LOOKUPVALUE(WCCSnapshot[PreviousYearDate],WCCSnapshot[ClaimID],ClaimRoot[ClaimID])&&ClaimRoot[ReportDateID]<=LOOKUPVALUE(WCCSnapshot[AsofDate],WCCSnapshot[ClaimID],ClaimRoot[ClaimID])))

 

Regards,

Greg_Deckler
Super User
Super User

I haven't wired this up yet, but you have a syntax error in your formula below, there should be a comma "," in front of FILTER.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
vickyprudhvi
Helper IV
Helper IV

@austinsense - Pls help

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.