How can I customize Subtotals/grand totals in Matrix visual Power bi using measures DAX - matrix

I have a matrix visual containing organisation hierarchy as rows and some custom metrics as columns.the column contains values like 100%,0%,EX. I am facing an issue when adding up these values (using inbuilt power bi Total).The issue is like when there are say 15 entries with 13 - 100%'s ,1 - 0%, 1 - EX the total will be EX.It would be great if anyone can help me with this.
Thanks in advance!
The expectation was 93% as when EX comes I want it to be removed from Numerator as well as the denominator. so the total is like 14/15 and that accounts for 93%
screenshot

Related

Subtracting multiple cells on Google Sheets + the use of IF ELSE

It's been weeks since I've been trying to solve this problem, I tried various formulas for this (ArrayFormula, ABS, SUMPRODUCT, using a negative sign on the cells), but I can't seem to get it right.
The correct way will always be manually subtracting the cells one by one but this will cause too much delay or problem if we have more than 100 rows on the sheets.
=if(D14<(E3-E4-E5-E6-E7-E8-E9-E10-E11-E12-E13),D14,E3-E4-E5-E6-E7-E8-E9-E10-E11-E12-E13)
Here's the link to the sheet: https://docs.google.com/spreadsheets/d/1fAPQHKupKglBAJpoxrcVqWP343m0P5QOj8zp1FvasEA/edit?usp=sharing
The overall idea for this is that the Total Purchased should be compared to the total sold. The 2201 value on the total sold is retrieved from another transactions sheet and it just totals every sold item, and then starting from E4 (170 in cell value) onwards, it decreases since we just need to know the number of sold items from that certain row.
Thank you very much for taking the time to read this. I'm looking forward to getting help from this as this stresses me for weeks now.
use cumulative function
=arrayformula(mmult(1*(transpose(row(D4:D))<=row(D4:D)),if(D4:D="",0,D4:D)))
and include in your formula in E4 as follows
=arrayformula(if(D4:D<($E$3-(mmult(1*(transpose(row(D4:D))<=row(D4:D)),if(D4:D="",0,D4:D)))),D4:D))

Cognos 10 Row cumulative expression

Im trying to make a cumulative formula to add the percentages up in the row with the percentages before it. it can be a random amount of columns ranging from 1 to 15 for example.
This shows me the percentages in a crosstab. i just need to make another crosstab that cumulatively adds the percentages
'percentage(Count( [Pickticket Control Number]))'
I've tried running totals and not manages to make headway. any help would be great.
for context there are 3 crosstabs. One is count of pickktickets, two is count of picktickets as % and third needs to be count of picktickets cumulative as a percentage.

Power BI Matrix Totals calculating incorrectly for

I am currently having an issue with the power bi Matrix Calculation when using dax. I need to calculate the Running total for overtime per fortnight, which I have achieved using the following
Lieu running total to Date = CALCULATE(SUM('Table1'[OT]),FILTER(ALLSELECTED('Calendar'[Date]),ISONORAFTER('Calendar'[Date], MAX('Calendar'[Date]), DESC)))
However I now need to calculate the excess hours (OT) which I have used the following to calculate people over 90 hours(additional 10 hours)
Excess Lieu2 = IF([Lieu running total in Date]>=160,[Lieu running total in Date]-160,0)
The issues is the the grand totals is calculating the entire total - 160
The the last few total rows as well as the grand total are aggregating incorrectly...ANy help is greatly appreciated. A Dax solution is needed as this will need to be dynamic as the employees names will be added
Add a new measure with below code and add that measure to your matrix.
Total_Lieu_running_total_to_Date =
SUMX (
SUMMARIZE (
table,//add the table from which the pay period end date is coming
table[pay period end date],//date column which you are using in matrix
"Lieu_running_total_to_Date",
[Lieu running total to Date] //measure which you using currently
),
[Lieu_running_total_to_Date]
)
Note:- Please add some sample data so it would help other to give you solution quickly.

Calculate Max from set of Calculated Measure in powerPivot

I have created a model in PowerPivot, and have many calculated measure to get the share value (%).
EX:
1. Brand 1 15%
2. Brand 2 34%
3. Brand 3 51%
To get each brand Share value i have written a Dax formula as below:
=(Sum(Column A)/Sum(Column b)).
Now i need to get the max of the share value (%) from the list of Brands we have. Can someone help me write another formula to get the max of share Value among all the brands.
i.e. Brand 3 51%.
Without knowing more about your model I can only propose to try measure below (if measure for brand shares is called ValueShare).
MaxShare = MAXX(ALL('Product'[Brands]),[ValueShare])

Calculate cumulative total in DAX?

I'm calculating cumulative total in DAX like:
DEFINE MEASURE 'Sales'[Running Total] =
CALCULATE (
SUM('Sales'[Revenue]),
FILTER(ALL('Date'[Date]),'Date'[Date]<=MAX('Date'[Date]))
)
This should be well-estabilished pattern (at least it is referenced here: http://www.daxpatterns.com/cumulative-total/)
My problem is when I try to evaluate it like:
EVALUATE SUMMARIZECOLUMNS(
'Date'[Date],
"Total_Revenue_By_Date",
'Sales'[Running Total]
)
I'm running into error
The resultset of a query to external data source has exceeded the maximum allowed size of '1000000' rows.
I'm using tabular model with direct query. I know I can enlarge the limit, however the underlying tables are small - Date table has around 10000 rows, Sales table has around 10000 rows as well (it will be much larger on production), so something here doesn't scale well.
I have an idea how to get away with calculating running totals on SQL level, any idea how to tackle this on DAX level ?
Models created by Power BI desktop has default limit of 1 million rows.
This might help you,
https://www.sqlbi.com/articles/tuning-query-limits-for-directquery/

Resources