cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Time Intelligence Date Question

Hi Guys. Wanted some help on the following. 

I have a table with two different dates showing two different revenue amounts. 

IDClaim DateClaim RevenueClaim Due DateDue Date Revenue
11/04/2020 $          123.001/04/2020 $                250.00
21/05/2020 $          150.001/05/2020 $                500.00
31/06/2020 $          271.001/06/2020 $                750.00
41/07/2020 $          329.331/07/2020 $             1,000.00
51/07/2020 $          429.441/07/2020 $             1,250.00

 

I am basically after a two fold step.

On the same chart, I would like to show (if possible) the Sum of Claim Revenue and Sum of Due Date Revenue only for the current month. 

for example, for month of May20, it should show two bar graphs (claimed revenue and due date revevue), which changes automatically to Jun20 next month. 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Memorable Member
Memorable Member

Re: Time Intelligence Date Question

Hello @adnanzakir ,

 

You need to take help of a calendar table

 

Once added in the model, create the relationship between the calendar table date, and Claim Date & Claim Due Date

 

2.JPG1.JPG

 

Then you can create following measures for calculating the total revenue on claim date and due date

 

Total Claim Revenue = 
CALCULATE(
    SUM(dtTable[Claim Revenue]),
    USERELATIONSHIP(dtCalendar[Date],dtTable[Claim Date])
)

Total Due Date Revenue = 
CALCULATE(
    SUM(dtTable[Due Date Revenue]),
    USERELATIONSHIP(dtCalendar[Date],dtTable[Claim Due Date])
)

 

You will get the following results:

 

3.JPG

 

Alternatively, you can use TREATAS function and skip the Relationship creation part suggested above (Calendar table is required though):

 

Total Revenue = 
CALCULATE(
    SUM(dtTable[Claim Revenue]),
    TREATAS(VALUES(dtCalendar[Date]),dtTable[Claim Date])
)

Total Due Date Revenue = 
CALCULATE(
    SUM(dtTable[Due Date Revenue]),
    TREATAS(VALUES(dtCalendar[Date]),dtTable[Claim Due Date])
)

 

Cheers!
Vivek

If it helps, please mark it as a solution
Kudos would be a cherry on the top 🙂

https://www.vivran.in/

Connect on LinkedIn

View solution in original post

5 REPLIES 5
Highlighted
Super User IV
Super User IV

Re: Time Intelligence Date Question

@adnanzakir , you can connect both dates with a same date table and use userelation to change the date

 

refer to example in blog how to use

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...


Appreciate your Kudos.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

Highlighted
Helper II
Helper II

Re: Time Intelligence Date Question

Hi Amit. 

Thanks for the reply. How would you calculate the current month? 

Highlighted
Helper II
Helper II

Re: Time Intelligence Date Question

Hi Amit. So I implemented a date table, and joined that with my main table through two relationships. One active and the other non active. The problem is, the amount being calculated is the overall amount, and not separated according to the months. 

Highlighted
Memorable Member
Memorable Member

Re: Time Intelligence Date Question

Hello @adnanzakir ,

 

You need to take help of a calendar table

 

Once added in the model, create the relationship between the calendar table date, and Claim Date & Claim Due Date

 

2.JPG1.JPG

 

Then you can create following measures for calculating the total revenue on claim date and due date

 

Total Claim Revenue = 
CALCULATE(
    SUM(dtTable[Claim Revenue]),
    USERELATIONSHIP(dtCalendar[Date],dtTable[Claim Date])
)

Total Due Date Revenue = 
CALCULATE(
    SUM(dtTable[Due Date Revenue]),
    USERELATIONSHIP(dtCalendar[Date],dtTable[Claim Due Date])
)

 

You will get the following results:

 

3.JPG

 

Alternatively, you can use TREATAS function and skip the Relationship creation part suggested above (Calendar table is required though):

 

Total Revenue = 
CALCULATE(
    SUM(dtTable[Claim Revenue]),
    TREATAS(VALUES(dtCalendar[Date]),dtTable[Claim Date])
)

Total Due Date Revenue = 
CALCULATE(
    SUM(dtTable[Due Date Revenue]),
    TREATAS(VALUES(dtCalendar[Date]),dtTable[Claim Due Date])
)

 

Cheers!
Vivek

If it helps, please mark it as a solution
Kudos would be a cherry on the top 🙂

https://www.vivran.in/

Connect on LinkedIn

View solution in original post

Highlighted
Helper II
Helper II

Re: Time Intelligence Date Question

Hi @vivran22 . Worked a treat my friend. Thanks for your help and indepth explanation with screenshots. Helped alot. 

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Community Summit Australia – Join Online!

Community Summit Australia – Join Online!

Be a part of the leading Microsoft Business Applications digital event, curated for the APAC community.

Top Solution Authors
Top Kudoed Authors