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
mikelimas
Regular Visitor

How to Visualize Account Activity by Attributes that change over time

I have regular monthly data like sales, number of licenses, and other account related information that I would like to relate against the attributes of accounts that change over time.  That is, I have a table sales activity for accounts and I also have a table of accounts and their attributes.  These attributes can change over time (month to month for example), so I would like to be able to relate the invoicing to the attributes that were in effect at that time, not just the most recent set of attributes I have.  

 

If I have a table that has the sales in it like this:

 

Date | Acct ID | Sales

5-Dec-2017 | 123456 | $10,000.00

8-Jan-2018 | 123456 | $10,500.00

12-Feb-2018 | 123456 | $10,750.00

 

and another table that includes Acct Attributes that can change each month like this:

 

Acct Date | Acct ID | Locations | Licenses | Segment

31-Dec-2017 | 123456 | 4 | 22 | Green

31-Jan-2017 | 123456 | 4 | 28 | Green

28-Feb-2017 | 123456 | 5 | 31 | Gold

 

I'd like to be able to build report that would be able to show something like:

 

Sales by Segment for Dec through Feb: 

 

Segment | Sales

Green | $20,500

Gold | $10,750

 

To date, I have been indexing the attributes I want to report by into each row of activity data before I bring it into my BI data and I have to believe there is a better way to do this.  I'd love some suggestions!

 

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@mikelimas,

 

You may refer to the following DAX that adds a calculated column.

Column =
MAXX (
    TOPN (
        1,
        FILTER (
            Table2,
            Table2[Acct ID] = Table1[Acct ID]
                && Table2[Acct Date] > Table1[Date]
        ),
        Table2[Acct Date], ASC
    ),
    Table2[Segment]
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-chuncz-msft
Community Support
Community Support

@mikelimas,

 

You may refer to the following DAX that adds a calculated column.

Column =
MAXX (
    TOPN (
        1,
        FILTER (
            Table2,
            Table2[Acct ID] = Table1[Acct ID]
                && Table2[Acct Date] > Table1[Date]
        ),
        Table2[Acct Date], ASC
    ),
    Table2[Segment]
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.