Forum Discussion
Anees91
1 year agoFrequent Visitor
DAX not working
Hi guys I'm working on a Pbi dashboard, mainly it's working fine, however I have an issue. so i have two columns for example, count of failure code and total delivery volume (including failure) .. i ...
- Anonymous1 year ago
Hi Anees91 ,
I made simple samples and you can check the results below:Table 2 = SUMMARIZE('Table',[Category]) Measure = var _s = SELECTEDVALUE('Table 2'[Category]) var _sum = COUNT('Table'[ID]) var _total = CALCULATE(COUNT('Table'[ID]),REMOVEFILTERS('Table'[Category]),FILTER('Table',[Fail]="Yes")) var _selecet = CALCULATE(COUNT('Table'[ID]),FILTER('Table',[Fail]="Yes"&&[Category]=_s)) RETURN IF(HASONEFILTER('Table 2'[Category]),1-DIVIDE(_selecet,_sum),1-DIVIDE(_total,_sum))An attachment for your reference. Hope it helps!
Best regards,
Community Support Team_ Scott ChangIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
Anees91
1 year agoFrequent Visitor
Thank you for replying, I have tried them to no success, I've even tried this where I would specify on a different column instead :
Service Success v1 =
VAR Numerator = CALCULATE(COUNT('Volume'[Service Failure.ConsignmentId]),
'Volume'[Failed] = "Fail")
VAR Denomiator = CALCULATE(COUNT(Volume[ConsignmentId])
)
RETURN
IF(
Denomiator = 0,
BLANK(),
1- (Numerator / Denomiator)
)
I was hoping this would have solved the issue as then the x axis on the bar chart is referring to a different failure column with different Categories. The number 1 in the measure means it's all fail. This measure seems fine, however again when i click on a bar filter - Failure.SFCCode, the measure this time goes to 0% as its not reflecting the filter i clicked on in the bar chart - I have checked the interactions and it seems fine
I was hoping this would have solved the issue as then the x axis on the bar chart is referring to a different failure column with different Categories. The number 1 in the measure means it's all fail. This measure seems fine, however again when i click on a bar filter - Failure.SFCCode, the measure this time goes to 0% as its not reflecting the filter i clicked on in the bar chart - I have checked the interactions and it seems fine