How do I get my DAX measure to calculate grouped values

0 votes

I need help with a DAX measure in my Power BI report. I am just learning about measures, so sorry if this seems like a newbie question.

I have a simple DAX measure that I use to calculate water usage for each location/sensor, for the current date range selected in the report (via Timeline control):

Usage:= (MAX([Reading]) - MIN([Reading]))

How can I get the measure to calculate the usage, grouped by the Sensor ID?

Oct 8, 2020 in Power BI by anonymous
• 8,870 points
797 views

1 answer to this question.

0 votes

Try this:

Total Usage:= SUMX( VALUES(MyTable[SensorID]), [Usage])

An alternative solution:

Total Usage:= SUMX( SUMMARIZE(MyTable, MyTable[SensorID]), [Usage])

It works the same way, only the list of unique sensor ids is returned by the SUMMARIZE function instead of VALUES.

answered Oct 8, 2020 by Gitika
• 65,770 points

Related Questions In Power BI

0 votes
1 answer

I want to calculate the distinct count of active customers but only for the last three completed months—how can I do this in DAX?

To calculate the distinct count of active ...READ MORE

answered 4 days ago in Power BI by anonymous
• 19,330 points
41 views
0 votes
3 answers

How do I get token using javascript API while trying to embed graphs using Power BI

You need to use the generate embed ...READ MORE

answered Oct 10, 2023 in Power BI by Monika kale

edited Mar 5 4,753 views
0 votes
1 answer

How to measure in DAX to calculate YTD for chosen month only for Power BI?

If you use the date column from FactTable, ...READ MORE

answered Dec 22, 2020 in Power BI by Gitika
• 65,770 points
5,023 views
+1 vote
2 answers

How do I download or have my Power BI Data Analyst certificate sent to my email?

To download your Power BI Data Analyst ...READ MORE

answered Oct 24, 2024 in Power BI by pooja
• 16,840 points
266 views
0 votes
1 answer
0 votes
1 answer

How to get month name from month number in Power BI?

You can use: MonthName = FORMAT(DATE(1, [Num], 1), ...READ MORE

answered Sep 24, 2020 in Power BI by Alisha
6,477 views
0 votes
1 answer

How to ignore a slicer for one measure, but apply it on another?

In order to ignore Slicer you need ...READ MORE

answered Oct 1, 2020 in Power BI by Gitika
• 65,770 points
7,232 views
0 votes
1 answer

How do I use the DAX function ParallelPeriod?

The DAX expression you used in the ...READ MORE

answered Oct 5, 2020 in Power BI by Gitika
• 65,770 points
1,140 views
0 votes
1 answer

How do I count rows in one table based on values in another table using DAX?

If the tables are related, this is ...READ MORE

answered Sep 24, 2020 in Power BI by Gitika
• 65,770 points
23,040 views
0 votes
1 answer

How to calculate PowerBI / DAX - Row wise division by measure?

As for your question, I think you're ...READ MORE

answered Oct 8, 2020 in Power BI by Gitika
• 65,770 points
4,140 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP