cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Need to write sql query from dax can anybody help me

Need to write sql query from dax query can anybody help me with that 

Total Calendar Days Pending – WIP Transactions = 
VAR SelLastDate = [Selected Last Date v2]
VAR SummaryTable =
CALCULATETABLE(
    SUMMARIZE(ClaimCase, ClaimCase[ClaimId], ClaimCase[Calendar Days Pending]),
        USERELATIONSHIP(ClaimCase[CaseCreationDateId], DimDate[DateId]),
        ALL(DimDate),
        ClaimCase[CaseCreatedOn] <= SelLastDate,
        ClaimCase[CompletedOn] = BLANK())
RETURN
SUMX(SummaryTable, ClaimCase[Calendar Days Pending])
1 REPLY 1
Super User IV
Super User IV

@Venkateswara_ra ,

Something like this

Select sum( ClaimCase[Calendar Days Pending]) from (
select distinct ClaimCase.[ClaimId], ClaimCase.[Calendar Days Pending]
from ClaimCase inner join DimDate on (ClaimCase.[CaseCreationDateId]= DimDate.[DateId])
where ClaimCase. [CaseCreatedOn] <= ?  // Date you have to pass
and ClaimCase[CompletedOn] is null
)

 

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Helpful resources

Announcements
secondImage

Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors