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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
gauri
Helper III
Helper III

challenge using two dates in enitre Report( date , effective date)

Hi all

 

I am in a fix how to solve this. Following is the issue :

In my Report i have some visuals which are  responsive to my calendar date tabel. In the image below

image 1.PNG

  The top card beside Average Past Due which is blank will contain the DSO calculated in it, and for calculating my DSO i have my revenue which is responsive from calendar date table and i have my aging amount which will be based on aging date. When i say aging date i mean a historical Aging, like if i am finding a DSO for JAN 2020 i will run my aging for 1-01-2020  and i will consider the total aging amount from this visual. So i am in a fix how can i use these two dates in a same visual or is their any other way doing this. Also can we get the historical aging ( where we can run aging for any period like jan , feb or may) without passing a parameter at the desktop and service, Or if i select my start date from the slicer then it should dyanamically change my calculated column which is calculated in the follwoing way :

Month = DATEDIFF(pcc_view_ar_aging[effective_date], pcc_view_ar_aging[Column1],MONTH).
My Column1 should hold the date which i will select in the slicer.
 
Regards,
Gauri P.

 

3 REPLIES 3
MFelix
Super User
Super User

Hi @gauri ,

 

For this you need to make use of a filtering option within the measure itself depending on the way you are calculating should be similar to:

 

Measure = CALCULATE(SUM(Table[Column]);FIlter(ALL(Table[Date]);Table[Date] <= MAX(Calendar[Date]) && Table[Date] >= DATEADD(MAX(Calenda[Date]);-1;year))

 

Be aware that this measure was done by heart may need some adjustments, the sum should be replace by your calculation.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



@MFelix  Can you explain that dax ( the -1 part)

On DATEADD function the second parameter is the number of periods you want to go back or front in this case I'm calculating previous year date so -1 year.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.