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.
I have a table that has mutiple values of "OPCount" as rows for each Faciliy name and each date. So i am summing them up to show the max for each day for each facilty.
Below is what i am using to summarize my rows(Please tell me if this is correct):
This is how i get my values - ie: max of among the rows. Butt, I need it to show as total of each column.
Solved! Go to Solution.
Hi @FeezaAga ,
To what I can understand from your data and the result you present is that the values you are picking up are the maximum values for each day correct?
I added a new value of 5 to facility A and day 1 in order to get two values for the same date:
Then I made some changes to the measure adding the factory to the sumx:
1OPCount =
IF (
HASONEFILTER ( 'Query1'[EachDay of month ] );
MAX ( 'Query1'[OPCount] );
SUMX (
SUMMARIZE (
'Query1';
'Query1'[EachDay of month ];
Query1[FacilityName];
"@Max"; MAX ( 'Query1'[OPCount] )
);
[@Max]
)
)
When making use of aggregate functions you need to refer to the columns you need, in this case the result of the summarize table is a table that picks up the value for each facility and each day and a single value for the OPCount.
Having the previous syntax what you are getting is a table with days and a value per each day so you only get the 551 has you final result, that is the higher value at the day level.
Check image below and PBIX file attach.
As you can see on facility A day 1 i have 11 and the 5 is not consider and if you sum all the days that are presented you get 1.093.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @FeezaAga ,
Has refered measures are based in context when in the syntax is refered HASONEFILTER(Table[EachDay]) means that it will check if there is a single value selection for EachDay son when it has one day then it will give MAX other wise is the sum of the values.
When you are filtering on a single day the HASONEFILTER is always true so returns always the maximum value and not the sum try to make the following change to your measure:
1OPCount =
IF (ISINSCOPE(Query1[EachDay of month ]);
MAX ( 'Query1'[OPCount] );
SUMX (
SUMMARIZE (
'Query1';
'Query1'[EachDay of month ];
Query1[FacilityName];
"@Max"; MAX ( 'Query1'[OPCount] )
);
[@Max]
)
)
Check PBIX file attach:
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsCovering 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 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |