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.
Hi - I have a data set with these columns:
I need to create a summary report like this, with the yellow columns being calculated from the columns in the data set. I have figured out how to use a measure to calculate the total data number and %>limit, but it only seems to work with the columns specificed (i.e. I would have to make 40+ measures to cover all of the contaminants). Is there a better way to accomplish this?
Currently this is done in Excel using the "countif" function and then manually inputing the values into the report table. We need to be able to keep adding rows to the data set and would like to have the report updated without manually inputting changes.
Best regards,
Jim
Solved! Go to Solution.
Yes. There is a better way. In the query editor, make two tables from your one.
In the first - keep all the first rows that have the sample metadata (origin, date tested, etc.). Make sure you keep SampleID as you will relate it to table 2.
In the second - remove the sample metadata rows and keep the SampleID column and all the results columns. Select SampleID, right click and choose unpivot other columns. You will get Attribute and Value columns (rename if you want). Make measures that analyze the Value column (avg result, % over limit, etc.). You can use the Attribute column as your rows or columns in a matrix visual. You can also make a Groups column to group Heavy Metals, etc. tests together to give you that higher level hierarchy of results.
https://exceleratorbi.com.au/grouping-in-power-bi-desktop-without-using-dax/
You may need a 3rd table to hold your limit values for each test (don't see that in your example data).
Note: you can just unpivot the result columns in your existing query but then you are duplicating all the metadata values in every row. The above approach to split into two tables is a better practice.
It is different that traditional Excel but it is the way to go. I am an Analytical Chemist and do this all the time. Feel free to post example data if additional help needed.
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hi @jtc017 ,
You may upload the excel files to SharePoint online since any changes in cloud data source will sync with report, then connect to the data using SharePoint folder connector in Power BI Desktop, use the URL below and use organizational account method. See more: Connecting to Files in SharePoint & OneDrive with Power BI / Power Query. In this way, you may needn't to import data manually to get updated data.
>>I have figured out how to use a measure to calculate the total data number and %>limit, but it only seems to work with the columns specificed (i.e. I would have to make 40+ measures to cover all of the contaminants).
For further analysis, you may clarify the logic about the yellow columns total data number and %>limit .
Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Share data in a format that can be pasted in an MS Excel file. Please show clearly how the numbers should be calculated for the 2 yellow columns.
Yes. There is a better way. In the query editor, make two tables from your one.
In the first - keep all the first rows that have the sample metadata (origin, date tested, etc.). Make sure you keep SampleID as you will relate it to table 2.
In the second - remove the sample metadata rows and keep the SampleID column and all the results columns. Select SampleID, right click and choose unpivot other columns. You will get Attribute and Value columns (rename if you want). Make measures that analyze the Value column (avg result, % over limit, etc.). You can use the Attribute column as your rows or columns in a matrix visual. You can also make a Groups column to group Heavy Metals, etc. tests together to give you that higher level hierarchy of results.
https://exceleratorbi.com.au/grouping-in-power-bi-desktop-without-using-dax/
You may need a 3rd table to hold your limit values for each test (don't see that in your example data).
Note: you can just unpivot the result columns in your existing query but then you are duplicating all the metadata values in every row. The above approach to split into two tables is a better practice.
It is different that traditional Excel but it is the way to go. I am an Analytical Chemist and do this all the time. Feel free to post example data if additional help needed.
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Thanks!
I think your solution will work, but I am having trouble figuring out the approriate DAX for the measure to give % > limit while referencing the correct limits. As you suggested, I have a 3rd table that holds the limits, but I am not sure how to reference them in the measure.
Table 3
The current formula I have for the measure is:
Nevermind! I finally realized my issues with the measures were because the data type was set as "Text" for the values column after unpivoting. Now that I have it set to Decimel number, the measures seem to be working.
Best regards,
Jim
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
95 | |
76 | |
65 | |
51 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |