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 in Power BI by anonymous
• 4,860 points
32 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 by Gitika
• 50,340 points

Related Questions In Power BI

0 votes
3 answers

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

Use ADAL.js that will give you an ...READ MORE

answered Jun 22, 2019 in Power BI by anonymous
2,083 views
0 votes
1 answer

How do I know who in my organization has a Power BI account?

You can view the Azure Active Directory ...READ MORE

answered Oct 15, 2018 in Power BI by Hannah
• 18,410 points
128 views
0 votes
1 answer

How can I concatenate grouped values in PowerQuery ?

If your table is Source, and if ...READ MORE

answered Feb 27, 2019 in Power BI by Shubham
• 13,450 points
1,328 views
0 votes
1 answer

How to calculate cumulative Total and % in DAX?

Hi, If your table is ready with percentage ...READ MORE

answered Mar 18, 2019 in Power BI by Cherukuri
• 32,490 points
9,849 views
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 in Power BI by Alisha
39 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 in Power BI by Gitika
• 50,340 points
234 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 in Power BI by Gitika
• 50,340 points
41 views
0 votes
1 answer
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 in Power BI by Gitika
• 50,340 points
71 views