Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Dear Team,
I have one DAX formula which is bit slow and it's not written in proper way, and I would like to rewrite this DAX code in some efficient way. Can someone assist me to rewrite this code please?
DAX
Select =
SWITCH (
MIN ( 'z III version selection'[slectionnum] ),
1,
CALCULATE (
[TotalAmount],
Azdan_data[Scenario] = "Budget",
'Azdan_data'[Version lookup] = 1,
LEFT ( Azdan_data[Account Code], 3 ) <> "414"
),
2,
CALCULATE (
[TotalAmount],
Azdan_data[Scenario] = "Budget",
'Azdan_data'[Version lookup] = 2,
LEFT ( Azdan_data[Account Code], 3 ) <> "414"
),
3,
CALCULATE (
[TotalAmount],
Azdan_data[Scenario] = "Budget",
'Azdan_data'[Version lookup] = 3,
LEFT ( Azdan_data[Account Code], 3 ) <> "414"
),
4,
CALCULATE (
[TotalAmount],
Azdan_data[Scenario] = "Budget",
'Azdan_data'[Version lookup] = 4,
LEFT ( Azdan_data[Account Code], 3 ) <> "414"
),
5,
CALCULATE (
[TotalAmount],
Azdan_data[Scenario] = "Budget",
'Azdan_data'[Version lookup] = 5,
LEFT ( Azdan_data[Account Code], 3 ) <> "414"
),
6,
CALCULATE (
[TotalAmount],
Azdan_data[Scenario] = "Budget",
'Azdan_data'[Version lookup] = 6,
LEFT ( Azdan_data[Account Code], 3 ) <> "414"
),
7,
CALCULATE (
[TotalAmount],
Azdan_data[Scenario] = "Budget",
'Azdan_data'[Version lookup] = 7,
LEFT ( Azdan_data[Account Code], 3 ) <> "414"
),
8,
CALCULATE (
[TotalAmount],
Azdan_data[Scenario] = "Budget",
'Azdan_data'[Version lookup] = 8,
LEFT ( Azdan_data[Account Code], 3 ) <> "414"
),
9,
CALCULATE (
[TotalAmount],
Azdan_data[Scenario] = "Budget",
'Azdan_data'[Version lookup] = 9,
LEFT ( Azdan_data[Account Code], 3 ) <> "414"
),
10,
CALCULATE (
[TotalAmount],
Azdan_data[Scenario] = "Budget",
'Azdan_data'[Version lookup] = 10,
LEFT ( Azdan_data[Account Code], 3 ) <> "414"
),
11,
CALCULATE (
[TotalAmount],
Azdan_data[Scenario] = "Budget",
'Azdan_data'[Version lookup] = 11,
LEFT ( Azdan_data[Account Code], 3 ) <> "414"
)
)
Solved! Go to Solution.
Select =
var __min = MIN ( 'z III version selection'[slectionnum] ) return
CALCULATE (
[TotalAmount],
Azdan_data[Scenario] = "Budget",
'Azdan_data'[Version lookup] = __min,
LEFT ( Azdan_data[Account Code], 3 ) <> "414"
)
________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
Try this please:
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Select =
var __min = MIN ( 'z III version selection'[slectionnum] ) return
CALCULATE (
[TotalAmount],
Azdan_data[Scenario] = "Budget",
'Azdan_data'[Version lookup] = __min,
LEFT ( Azdan_data[Account Code], 3 ) <> "414"
)
________________________
If my answer was helpful, please consider Accept it as the solution to help the other members find it
Click on the Thumbs-Up icon if you like this reply 🙂
Try this please:
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
User | Count |
---|---|
12 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
19 | |
14 | |
10 | |
7 |