This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
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 May 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 |
|---|---|
| 31 | |
| 26 | |
| 23 | |
| 22 | |
| 15 |
| User | Count |
|---|---|
| 62 | |
| 47 | |
| 28 | |
| 24 | |
| 21 |