The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Im using this dax function, I would like to also display the "NO" otif quanitty % correctly. Now only show the Yes % is correctly. Please help and thanks so much.
Hi @SelflearningBi ,
In this case your issue is with the context of the calculation, since you are using the column OTIF has a context on the matrix visualization the CALCULATE function is making use of the ALL statement that way you are always getting the YES on your formula try to change the first part of the divide you will get the correct result try to replace your formula by:
OTIF Quantity % =
VAR sumofconfirmedqty =
CALCULATE (
SUM ( 'FW22 Order Database'[shipped Quantity(Total)] ),
'FW22 Order Database'[OTIF] = "YES"
|| 'FW22 Order Database'[OTIF] = "NO"
)
RETURN
DIVIDE (
SUM ( 'FW22 Order Database'[shipped Quantity(Total)] ),
sumofconfirmedqty
)
This should give expected result.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português
trial_OTIF Quantity % =
VAR sumofconfirmedqty = CALCULATE ( SUM ( 'FW22 Order Database'[shipped Quantity(Total)] ), 'FW22 Order Database'[OTIF] = "YES" || 'FW22 Order Database'[OTIF] = "NO" )
RETURN DIVIDE ( CALCULATE('A-measure'[Sum Shipped Qty],'FW22 Order Database'[OTIF]="yes"), sumofconfirmedqty )
Hi, thanks for helping. I am using this formula but still only get the same result, and also I put the IN FULL column in the table. The table only displays YES. do you have any suggestution for that?
this is the new column I created
In Full =
SWITCH(TRUE(),
ISBLANK('FW22 Order Database'[Shipped Qty Difference]),BLANK(),
IF(AND('FW22 Order Database'[Shipped Qty Difference]>=0,'FW22 Order Database'[Shipped Qty Difference]<=0.02),"Yes","No"))
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
100 | |
94 | |
81 | |
63 | |
56 |
User | Count |
---|---|
247 | |
122 | |
110 | |
77 | |
72 |