Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
Hi,
I have 100 + material codes & I want to get Sales of selected materials.
I gets sales of a single material code with below formula in "New Measure"
Sales = Calculate CALCULATE(([Sales Amt],(Sheet1[Material Code]="100495")
But, I fails with multiple material codes ;
Sales = Calculate CALCULATE(([Sales Amt],(Sheet1[Material Code]="100495","100395","100503")
Error.
Please advice.
Thanks in advance
Ashley
Solved! Go to Solution.
@Ashwin_Wadalkar
Use it this way:
Sales =
CALCULATE(
[Sales Amt],
Sheet1[Material Code] IN {"100495","100395","100503"}
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Please guide me on which function i can use for ;
- And (viz....code "100495" And " 100395" And " 100503")
- OR (viz....either code "100495" or " 100395" or " 100503")
Thanks
@Ashwin_Wadalkar
not sure if I understand - but for And, use AND function:
https://docs.microsoft.com/en-us/dax/and-function-dax (or you can use operator &&)
for Or function use OR:
https://docs.microsoft.com/en-us/dax/or-function-dax
@Ashwin_Wadalkar
Use it this way:
Sales =
CALCULATE(
[Sales Amt],
Sheet1[Material Code] IN {"100495","100395","100503"}
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Hi,
Have you tried OR operator ||?
Try:
Sales = Calculate CALCULATE(([Sales Amt],(Sheet1[Material Code]="100495" || Sheet1[Material Code]= "100395" || Sheet1[Material Code]= "100503")
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
69 | |
62 | |
18 | |
16 | |
13 |