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
Bridgewater
Frequent Visitor

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. 

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
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 )

 

 

 

 


Regards
Zubair

Please try my custom visuals

View solution in original post

5 REPLIES 5
Zubair_Muhammad
Community Champion
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 )

 

 

 

 


Regards
Zubair

Please try my custom visuals

Thank you @Zubair_Muhammad, the sample data worked out perfectly.

 

There is still as issue whenever I plug in the real data. I am getting this error: 

 

'The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.'

 

I thought I had plugged in everything exactly as you did with your calculated table. Do you have any insight as to why this error is occurring?

Fixed! Just had to toy around with it.

 

Thank you @Zubair_Muhammad

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.