The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hello everyone,
I have a spreadsheet with temperature records from several loggers.
I need to find out how many loggers have an average temperature above a certain value (temperature rounded down without decimals).
I can calculate this using a combination of a pivot table and Excel formulas, but I can't create a calculated field or measure in the pivot table (PowerPivot) that would do this automatically and of course dynamically based on the filters and slicers used, as you can see in the attached file.
The certain value or values is a list with the average temperatures of all loggers rounded down without decimals (integers) in my file labeled as "BaseTemp".
I need to find out how many loggers have an average temperature above 20°C (20<=AVGTemp<21), than 21°C (21<=AVGTemp<22), etc.
Currently I have a pivot table of average temperatures + a helper column of rounded down values, and a table that counts the occurrences of each temperature in the helpere column.
And I want to automate all this and have it in one resulting pivot table.
Please provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.
Hello,
I apologise for my description. I probably expressed myself inaccurately.
Sample data is in linked file "Distinct Temp.xlsx" Sheet name: Data
The expected result is on the "PowerPivot" sheet, where is my actual procedure with the helper column and the resulting FinalTable.
My goal is to create a Pivot table with the same results as in the FinalTable, which will be dynamically recalculated according to the applied filters (slicers).
Note: a comma is used as the decimal separator in the spreadsheet.
Your table shows the number of records in the [Sensor No] column that match the list of unique temperatures from the [Temperature (int)] column.
If I change Number of Sensors to Number of Sensors (Distinct), I get the number of sensors with the corresponding temperature, but from the [Temperature (int)] column, where the values are already rounded down.
What I need are the total average temperatures of the individual sensors from the [Temperature (°C)] column, which are then rounded down without decimals, and only from these values I determine the number of sensors (distinct count) whose value is above the relevant temperature (list of unique temperatures in the [Temperature (int)] column
Is it possible to do this using DAX?
if a sensor is above 17 then it is also above 13, no?
Yes, you're right.
But I expect a number of temperature values between integers (i, i+1).
I.e. average temperature above 20°C but less than 21°C (20<=AVGTemp<21),
above 21°C but less than 22°C (21<=AVGTemp<22), etc.
That's then back to your buckets. Not really sure what you are asking for.
I probably can't describe it better than on the "PowerPivot" sheet in my xlsx file.
There is a functional calculation using the pivot table and standard Excel functions.
What is your "certain value" ?
User | Count |
---|---|
14 | |
12 | |
8 | |
6 | |
5 |
User | Count |
---|---|
28 | |
19 | |
13 | |
7 | |
5 |