Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi all,
I'm trying to get the total with the following conditions:
1. IsNet = True
2. SupplierCode = only selected code (say 1102 and 1103)
3. Specifically just for CompanyCode 6601, I would like to get the total even though IsNet is False (selected supplier code still applies)
Not sure what's the best approach. I tried to create custom column with IF statement creating True/False but, I can't get all the conditions.
This is what the data looks like:
Company Code | IsNet | SupplierCode | Total |
6601 | True/False | 1101 | |
6602 | 1102 | ||
6603 | 1103 | ||
6604 | 1104 |
Any help would be appreciated!!
Solved! Go to Solution.
@Helpful_Fun4848
Create the following measure:
Total Measure =
CALCULATE(
SUM(Table2[Total]),
Table2[IsNet] = TRUE()
)
+
CALCULATE(
SUM(Table2[Total]),
Table2[Company Code] = 6601
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@Helpful_Fun4848
Do you need a measure that gives you the total based on your conditions? IF so, which column should I sum?
For the SupplierCode, hope you will have a slicer in the report.
Please explain
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Yes, I need the sum of Total column based on the conditions.
As for slicer, does filter for suppliercode works as well? Or, does it have to be a slicer?
@Helpful_Fun4848
Create the following measure:
Total Measure =
CALCULATE(
SUM(Table2[Total]),
Table2[IsNet] = TRUE()
)
+
CALCULATE(
SUM(Table2[Total]),
Table2[Company Code] = 6601
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
It looks like it works but I need to double check the result.
Also, want to double check the following. I need to create another measure where the condition is the opposite of the measure that you created. This time, I do not want to include company code 6601 and IsNet = false.
Does the following measure correct?
CALCULATE(
SUM(Table2[Total]),
Table2[IsNET] = FALSE()
)
+
CALCULATE(
SUM(Table2[Total]),
Table2[Company Code] <> 6601
)
@Helpful_Fun4848
Yes, it should work, test and update please.
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group