Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

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. 

  • Hello Anonymous ,

     

    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

     

     

    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:

     

     

    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

5 Replies