Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric certified for FREE! Don't miss your chance! Learn more
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 |
|---|---|
| 68 | |
| 60 | |
| 47 | |
| 20 | |
| 16 |
| User | Count |
|---|---|
| 107 | |
| 107 | |
| 39 | |
| 27 | |
| 27 |