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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
dcheng029
Frequent Visitor

How to create report and calculations with 3 main datasets?

Hi all,

 

I am working with the below data sources:

Dataset 1 - shows a list of reported controls with the parent/main controls.

dcheng029_0-1722234384965.png

Dataset 2 - shows a list of staff and what controls they conducted.

dcheng029_1-1722234418980.png

Dataset 3 - shows a list of staff and what controls they are deemed competent (C).

dcheng029_2-1722234468410.png

 

I want to create Power BI calculations to essentially show the number of competent and incompetent cases closed by each staff member as per below:

dcheng029_3-1722234539901.png

My main question is how do I tell Power BI the relationship between main and reported control on Dataset 1? As Dataset 2 uses "Reported Control" and Dataset 3 uses "Main Control".

 

Any help is appreciated, thank you in advance!

 

8 REPLIES 8
Ashish_Mathur
Super User
Super User

Hi,

Share the download link of the PowerBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi Ashish,

Thanks for the response. Please let me know if below link doesn't work (organisation limits public share permissions).

 

https://drive.google.com/file/d/1EBc4twnqcdMWc6iO6Mr6gXWDmuYFcBUO/view?usp=share_link

I do not see any similarity between the data in the file and the tables you posted in your original message.  Please simplify the data in the file and show the expected result there.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Please see below link, let me know if this is sufficient.

 

https://drive.google.com/file/d/16RQljs2XWBALDVzKQVbjMU-SSP4yvwCS/view?usp=drivesdk

What is the problem there?  Show/State that clearly.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

My question and problem was clearly stated in the original post:

My main question is how do I tell Power BI the relationship between main and reported control on Dataset 1? As Dataset 2 uses "Reported Control" and Dataset 3 uses "Main Control".

 

Dataset 2 uses reported controls (i.e. Control 1A, Control 2B, etc.) whereas Dataset 3 uses main controls (i.e. Control 1, 2, 3, etc.). The control 'families' are dictated on Dataset 1. How do I link Dataset 2 and 3 controls using the logic from Dataset 1.

bhanu_gautam
Super User
Super User

@dcheng029 , First create relationship between Dataset 1 and Dataset 2 and , Dataset 1 and Dataset 3 on the basis of control column

Then create a measure for Competent cases

CompetentCases =
CALCULATE(
COUNTROWS(Dataset2),RELATED(Dataset3[Competency]) = "C"
)

 

One more for Incompetent cases

IncompetentCases =
CALCULATE(
COUNTROWS(Dataset2),
RELATED(Dataset3[Competency]) <> "C"
)

 

Then

Create a Table or Matrix Visualization:

Drag the "Staff Member" field from Dataset 2 to the rows of the table or matrix.
Drag the "CompetentCases" and "IncompetentCases" measures to the values section.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Thanks for the response!

When trying to create the measure for CompetentCases, an error appears saying "The column 'Dataset3[Competency]' either doesn't exist or doesn't have a relationship to any table available in the current context." Any ideas what this indicates?

 

I created relationships between Dataset 1 and 2 as well as Dataset 1 and 3 with the only option available but not sure where I have gone wrong.

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.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

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