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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
hgzelaya
Helper I
Helper I

Need help with really hard task. Same Date and ID Relationship

Hello everyone, i have 2 data tables. One of them including month, id, status and sales. The other data table includes month, id and Transaction. 

 

What i desire is to show in a clustered stacked column chart the amount of sales, count transtions and status after i have filtered these by the ID number.

 

Example:

2019-05-16 17_56_39-Libro2 - Excel.jpg

Is it possible???

 

 

Data Info: 

https://docs.google.com/spreadsheets/d/1oFMtGZHqbupQrCwnVdfM0UomFkG3EzwAub027AWr5kE/edit#gid=0

 

 

First Data Table
MonthIDSalesStatus
Jan11000
Feb11200
Mar12202
Apr12300
Jan21800
Feb22202
Mar22300
Apr21900
Jan31955
Feb32402
Mar32300
Apr32202

 

 

2nd Data Table
MonthIDTransaction
Feb2A1
Feb3B3
Mar1C2
1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi, @hgzelaya 

You could use this way:

Step1:

Add two dim tables: Dim Month table and Dim ID table

Step2:

Then create the relationship as below:

4.JPG

Step3:

Create three measure for "amount of sales, count transtions and status"

amount of sales = CALCULATE(SUM(Table1[Sales]))

count transtions = CALCULATE(COUNTA(Table2[Transaction]))

Status measure = CALCULATE(SUM(Table1[Status]))

From your screenshot, if it is sum(status)? if not just replace SUM(Table1[Status]) with COUNTA(Table1[Status])  

Step4:

Then use Combo Chart in Power BI, use Month field from Dim Month table as X-axis, ID field from DIm ID table as a slicer.

https://docs.microsoft.com/en-us/power-bi/visuals/power-bi-visualization-combo-chart

Result:

5.JPG

here is sample pbix file, please try it.

 

Best Regards,

Lin

Community Support Team _ Lin
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-lili6-msft
Community Support
Community Support

hi, @hgzelaya 

You could use this way:

Step1:

Add two dim tables: Dim Month table and Dim ID table

Step2:

Then create the relationship as below:

4.JPG

Step3:

Create three measure for "amount of sales, count transtions and status"

amount of sales = CALCULATE(SUM(Table1[Sales]))

count transtions = CALCULATE(COUNTA(Table2[Transaction]))

Status measure = CALCULATE(SUM(Table1[Status]))

From your screenshot, if it is sum(status)? if not just replace SUM(Table1[Status]) with COUNTA(Table1[Status])  

Step4:

Then use Combo Chart in Power BI, use Month field from Dim Month table as X-axis, ID field from DIm ID table as a slicer.

https://docs.microsoft.com/en-us/power-bi/visuals/power-bi-visualization-combo-chart

Result:

5.JPG

here is sample pbix file, please try it.

 

Best Regards,

Lin

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

Thank you so much it worked as i needed!

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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