Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
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.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 55 | |
| 48 | |
| 38 | |
| 16 | |
| 15 |
| User | Count |
|---|---|
| 85 | |
| 70 | |
| 38 | |
| 28 | |
| 25 |