Forum Discussion

Bridgewater's avatar
Bridgewater
Frequent Visitor
8 years ago
Solved

Dynamic Group Data Working with Date Slider

Hi all,

 

In a previous post (click here) You all helped me combine sales teams with their respective subteams. I now need to take that same approach and have those sales numbers work with a Date slider. I have been trying for a couple weeks now to no avail. Here is the situation:

 

Current Data: Sales teams and their sub teams are separated for data entry purposes. For display purposes they need to be combined. The result I am looking for is a clustered bar chart that can be filtered by date.

 

Team      Sub Team Amount   Date

A 965.441-Jan
A 747.361-Jan
A 306.361-Jan
A 1467.602-Jan
A 1717.202-Jan
B 433.681-Jan
B 1555.082-Jan
C 1270.321-Jan
DD12203.681-Jan
DD11341.841-Jan
DD12112.722-Jan
DD21371.001-Jan
DD2478.561-Jan
DD2903.002-Jan
DD2634.922-Jan
DD21415.402-Jan

 

What the data need to look like: Phil_Seamark helped with this solution previously, however there were no dates attached (I did not ask for dates in the original post). What you will notice is in this table below the Totals for Subteams D1 and D2 make up the aggregate total for Team D, however, they are still displayed and ranked in order with the rest of the teams.

 

Team       Amount    Date

D5395.081-Jan
D13545.521-Jan
A2019.161-Jan
D21849.561-Jan
C1270.321-Jan
B433.681-Jan
D5066.042-Jan
A3184.82-Jan
D22953.322-Jan
D12112.722-Jan
B1555.082-Jan

 

Here is the calculated table that was given to solve this initially without dates. This table sorts everything correctly but because it simply totals the numbers (which is what I originally asked) I cannot filter it by date.

 

Table 3 = 
VAR SalesSubTeam =  FILTER(Table1,'Table1'[Sales Sub Team] <> BLANK())
RETURN 
 GROUPBY(
                UNION (
				SELECTCOLUMNS(Table1,"Sales Team",[Sales Team] , "Sales Amount" , [Sale Amount]) ,
				SELECTCOLUMNS(SalesSubTeam,"Sales Team",[Sales Sub Team] , "Sales Amount" , [Sale Amount])
				),
                 [Sales Team],
                 "Sales Amount",SUMX(CURRENTGROUP(),[Sales Amount])
                 )

 

Any help with this would be useful. 

  • Hi Bridgewater

     

    Try this calculated Table.

    Then add a Date Slider using Date Column from this Calculated Table

     

    New Table =
    VAR TeamTable =
        SUMMARIZE (
            TableName,
            TableName[Team],
            TableName[Date],
            "Amount", SUM ( TableName[Amount] )
        )
    VAR SubTeamTable =
        FILTER (
            SUMMARIZE (
                TableName,
                TableName[Sub Team],
                TableName[Date],
                "Amount", SUM ( TableName[Amount] )
            ),
            TableName[Sub Team] <> BLANK ()
        )
    RETURN
        UNION ( TeamTable, SubTeamTable )

     

     

     

     

5 Replies

  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    Community Champion

    Hi Bridgewater

     

    Try this calculated Table.

    Then add a Date Slider using Date Column from this Calculated Table

     

    New Table =
    VAR TeamTable =
        SUMMARIZE (
            TableName,
            TableName[Team],
            TableName[Date],
            "Amount", SUM ( TableName[Amount] )
        )
    VAR SubTeamTable =
        FILTER (
            SUMMARIZE (
                TableName,
                TableName[Sub Team],
                TableName[Date],
                "Amount", SUM ( TableName[Amount] )
            ),
            TableName[Sub Team] <> BLANK ()
        )
    RETURN
        UNION ( TeamTable, SubTeamTable )