This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hello, I have the following SQL-Script and want to convert it to DAX.
SELECT top (1) abs((i.[MVA_L1_5_MAG01_246]-(lead(i.[MVA_L1_5_MAG01_246],1,0)over(order by i.[Date] desc)))) as' Mischerstange 1',
abs((i.[MVA_L1_5_MAG01_250]-(lead(i.[MVA_L1_5_MAG01_250],1,0)over(order by i.[Date] desc)))) as' Mischerstange 2',
abs((i.[MVA_L1_5_MAG01_254]-(lead(i.[MVA_L1_5_MAG01_254],1,0)over(order by i.[Date] desc)))) as' Mischerstange 3',
abs((i.[MVA_L1_5_MAG01_258]-(lead(i.[MVA_L1_5_MAG01_258],1,0)over(order by i.[Date] desc)))) as' Mischerstange 4',
(i.[MVA_L1_5_MAG01_246]-(lead(i.[MVA_L1_5_MAG01_246],1,0)over(order by i.[Date] desc)))*100/i.Gesamtverbrauch as 'Verbrauch 1',
(i.[MVA_L1_5_MAG01_250]-(lead(i.[MVA_L1_5_MAG01_250],1,0)over(order by i.[Date] desc))) *100/i.Gesamtverbrauch as 'Verbrauch 2',
(i.[MVA_L1_5_MAG01_254]-(lead(i.[MVA_L1_5_MAG01_254],1,0)over(order by i.[Date] desc)))*100/i.Gesamtverbrauch as 'Verbrauch 3',
(i.[MVA_L1_5_MAG01_258]-(lead(i.[MVA_L1_5_MAG01_258],1,0)over(order by i.[Date] desc)))*100/i.Gesamtverbrauch as 'Verbrauch 4'
From(
Select TOP 2 [Date]
,[MVA_L1_5_MAG01_246]
,[MVA_L1_5_MAG01_250]
does anyone have a suggestion how I can convert this script into DAX?
,[MVA_L1_5_MAG01_254]
,[MVA_L1_5_MAG01_258],
(([MVA_L1_5_MAG01_246]-(lead([MVA_L1_5_MAG01_246],1,0)over(order by [Date] desc)))+([MVA_L1_5_MAG01_250]-(lead([MVA_L1_5_MAG01_250],1,0)over(order by [Date] desc)))+([MVA_L1_5_MAG01_254]-(lead([MVA_L1_5_MAG01_254],1,0)over(order by [Date] desc)))+([MVA_L1_5_MAG01_258]-(lead([MVA_L1_5_MAG01_258],1,0)over(order by [Date] desc)))) as Gesamtverbrauch
FROM [MEG_LMSdataLogger].[dbo].[Dashboard_PRW_L1_5]
where datepart(hh,[Date]-1)=6 and datepart(hh,[Date])=6 AND datepart(minute,[DATE])=00
order by [Date] desc
)i
Solved! Go to Solution.
@Anonymous,
You may take a look at the links below.
@Anonymous,
You may take a look at the links below.
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 35 | |
| 32 | |
| 25 | |
| 22 | |
| 18 |
| User | Count |
|---|---|
| 66 | |
| 36 | |
| 32 | |
| 25 | |
| 23 |