Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
bideveloper555
Helper IV
Helper IV

Clustered Bar chart with out aggreation.

hi

this is the second request.i feel its bit diffcult to figure this out.

first table is kind of customer info, john has 3 properties and 2 of them have fixed fees.(12 months)

second table,transcation of each of his property.

i am trying to show a bar chart,fixed fee vs sum of trans amount.in below i gave only 3 months but actually can have years of data.

lets say, i need to show john first property(r_ID = 12)

bar chart should show 5000 vs 9000 which i can do on table chart but i cant  on bar chart,as table chart has dont summarize.

bideveloper555_0-1610992106994.png

 

 T_IDr_IDnamefee  
 112john5000  
 245john4000  
 312john   
       
       
 IDT_IDperiodAmt  
 41jan2000  
 51feb3000  
 61mar4000  
 72jan6000  
 82feb2000  
 92mar3000  
       
 periodT_IDnamefeeamt 
 for 3 months1John50009000 
 for 3 months2john400011000 
       

 

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @bideveloper555 ,

Since you may have a whole year of data for each T_ID and your month column is a text type instead of a date column, assuming you sort the month of each T_ID by the size of each ID, the sum of 3 months ago should be from every The sum of the 3 rows before the maximum ID of a T_ID, you can create the following measures:

previous 3 months Fee = 
CALCULATE (
    SUM ( Fee_table[fee] ),
    FILTER (
        ALL ( Fee_table ),
        'Fee_table'[T_ID] IN DISTINCT ( 'Amt_Table'[T_ID] )
    )
)
previous 3 months Amt = 
CALCULATE (
    SUM ( Amt_Table[Amt] ),
    FILTER (
        ALL ( Amt_Table ),
        'Amt_Table'[T_ID]
            IN DISTINCT ( Fee_table[T_ID] )
                && 'Amt_Table'[ID]
                    <= CALCULATE (
                        MAX ( 'Amt_Table'[ID] ),
                        FILTER ( Amt_Table, 'Amt_Table'[T_ID] = EARLIER ( Amt_Table[T_ID] ) )
                    )
                && 'Amt_Table'[ID]
                    >= CALCULATE (
                        MIN ( 'Amt_Table'[ID] ),
                        FILTER ( Amt_Table, 'Amt_Table'[T_ID] = EARLIER ( Amt_Table[T_ID] ) )
                    ) - 2
    )
)

re.png

Attached a sample file in the below, hopes to help you.

 

Best Regards,
Community Support Team _ Yingjie Li
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

2 REPLIES 2
v-yingjl
Community Support
Community Support

Hi @bideveloper555 ,

Since you may have a whole year of data for each T_ID and your month column is a text type instead of a date column, assuming you sort the month of each T_ID by the size of each ID, the sum of 3 months ago should be from every The sum of the 3 rows before the maximum ID of a T_ID, you can create the following measures:

previous 3 months Fee = 
CALCULATE (
    SUM ( Fee_table[fee] ),
    FILTER (
        ALL ( Fee_table ),
        'Fee_table'[T_ID] IN DISTINCT ( 'Amt_Table'[T_ID] )
    )
)
previous 3 months Amt = 
CALCULATE (
    SUM ( Amt_Table[Amt] ),
    FILTER (
        ALL ( Amt_Table ),
        'Amt_Table'[T_ID]
            IN DISTINCT ( Fee_table[T_ID] )
                && 'Amt_Table'[ID]
                    <= CALCULATE (
                        MAX ( 'Amt_Table'[ID] ),
                        FILTER ( Amt_Table, 'Amt_Table'[T_ID] = EARLIER ( Amt_Table[T_ID] ) )
                    )
                && 'Amt_Table'[ID]
                    >= CALCULATE (
                        MIN ( 'Amt_Table'[ID] ),
                        FILTER ( Amt_Table, 'Amt_Table'[T_ID] = EARLIER ( Amt_Table[T_ID] ) )
                    ) - 2
    )
)

re.png

Attached a sample file in the below, hopes to help you.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

parry2k
Super User
Super User

@bideveloper555 see if attached is what you are looking for

 

Check my latest blog post Compare Budgeted Scenarios vs. Actuals to get a summary of my favourite Power BI feature releases in 2020

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.