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
admin_xlsior
Post Prodigy
Post Prodigy

SUMMARIZE DAX With Selected Date

Hi guys,

 

Can we use SUMMARIZECOLUMN (or SUMMARIZE) by filtering it based on the Date selected from the slicer ?

So I have this transaction (MyTrans):

INVOICEDATEPARTNOAMOUNT
1/1/1900P-1000920
1/9/2015P-10002845200
1/9/2015P-10002945200
2/8/2016P-10024945200
2/8/2016P-10025045650
2/8/2016P-10025145650
2/8/2016P-10025047050
2/8/2016P-10025347050
2/8/2016P-10025951250
3/14/2016P-10025028500
3/14/2016P-10036029900
3/17/2016P-10026045200
3/17/2016P-10026146850

 

And I would like to group it based on INVOICEDATE, usually I would only do SUMMARIZE like :

SUMMARIZE(MyTrans, InvoiceDate. SUM(Amount) 

 

But I have a slicer Date, which someone will put a date, and the SUMMARIZE will need to filter only up to that selected date.

For some reason I cannot create relationship between my transaction table to Date dimension, so I need to filter that in that SUMMARIZE function.

My measure to capture the date is "SelectDate = SELECTEDVALUE(DimDate[Date])

 

When I create the summary using :

SUMMARIZE (

FILTER(MyTrans, MyTrans[InvoiceDate]<=[SelectDate]),

MyTrans[INVOICEDATE].

"Amount", SUM(MyTrans[AMOUNT])

)

or 

 

SUMMARIZECOLUMN(

MyTrans[INVOICEDATE), 

FILTER(MyTrans, MyTrans[InvoiceDate]<=[SelectDate]),

"Amount", SUM(MyTrans[AMOUNT])

)

Both of them returns no records. If I checked the measure, using Card, it did captured the date selected.

 

Thanks,

1 REPLY 1
amitchandak
Super User
Super User

Can you try in the selected date 

 

max(DimDate[Date])

maxx(DimDate,DimDate[Date])

\Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

 

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.