Forum Discussion
Measure Total is wrong
- 4 years ago
Ok, I just tried these out:
With both dimensions:
Sum +ves = SUMX ( 'FactTable', CALCULATE ( IF ( [Sum Amount] - [Sum Target] < 0, 0, [Sum Amount] - [Sum Target] ) ) )With 1 dimension
Sum +ves Cat = VAR _cat = ADDCOLUMNS ( VALUES ( FactTable[Category] ), "_+ves", IF ( [Sum Amount] - [Sum Target] < 0, 0, [Sum Amount] - [Sum Target] ) ) RETURN SUMX ( _cat, [_+ves] )I've attached the sample PBIX file
- Anonymous4 years ago
it works for me after doing some R&D.
measure C = meaasure A- Measure B.
+ve total = Calculate([C],FILTER(SUMMARIZE(FACTTABLE,PARENTDIMTABLE[COLUMN],FACTTABLE[COLUMN]),[C]>0))
Hi,
I have a similar issue that isn't resolved. I tried using the HASNOFILTER with SUMX but I am still getting wrong total for the measure. I have more details on the problem below, hopefully I am able to communicate clearly as I am new to using Power BI
I am working with a timesheet table that shows how many hours employees are using for various activities daily. This timesheet also reports PTO and Holiday Hours. I am trying to compute the total available hours on a periodic basis- daily, weekly, monthly, etc. Using a weekly time period, the total available hours is calculated as: 40 hours (i.e. 5 days * 8 hours) - PTO hours - Holiday hours.
In the timesheet table, I have created a measure that sums all hours logged as PTO (PTO is conditioned on the activity field i.e. activity would be vacation, sick, etc). The query is
I have created a Calendar table that has fields:
Date Column: All dates in the year 2022 (increments daily, the current max date is today's date),
'Work hours' (Values is 8 hours for dates on Mon-Fri, 0 for Sat and Sun)
Holiday Hours (Value is 8 hours for every holiday in the year; Holidays are fixed days annually).
To calculate the Available Hours, I created a measure