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.
I have a date column in my data, but the format and data type is not a date. The format is 01220102 which is January 02, 2022. I want to right a SQL statement in the adavanced options that will pull records that are the maximum value - X. For example, only return records ColumnX >= (Max(ColumnX)-200).
Any help is appreciated!
Solved! Go to Solution.
Hi @jackofalltrades ,
Are you connecting to the sql data source on the desktop? If so, you can try to use dax.
Create a measure.
Measure=VAR _MAXVALUE=MAXX(ALL(TABLE),ColumnX)
VAR _MAX200=_MAXVALUE-200
return
IF(MAX(ColumnX)>=_MAX200&&MAX(ColumnX)<=_MAXVALUE,1,BLANK())
Or a column.
Column=VAR _MAXVALUE=MAXX(TABLE,ColumnX)
VAR _MAX200=_MAXVALUE-200
return
IF(ColumnX>=_MAX200&&ColumnX<=_MAXVALUE,1,BLANK())
If you want to use sql formula in SQL, then you need to go to the SQL forum.
If I have misunderstood your meaning, please provide some simple sample data without privacy information and your desired output.
How to Get Your Question Answered Quickly
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I will move to the SQL forum. My apologies for posting in the wrong area. Thanks!
Hi @jackofalltrades ,
Are you connecting to the sql data source on the desktop? If so, you can try to use dax.
Create a measure.
Measure=VAR _MAXVALUE=MAXX(ALL(TABLE),ColumnX)
VAR _MAX200=_MAXVALUE-200
return
IF(MAX(ColumnX)>=_MAX200&&MAX(ColumnX)<=_MAXVALUE,1,BLANK())
Or a column.
Column=VAR _MAXVALUE=MAXX(TABLE,ColumnX)
VAR _MAX200=_MAXVALUE-200
return
IF(ColumnX>=_MAX200&&ColumnX<=_MAXVALUE,1,BLANK())
If you want to use sql formula in SQL, then you need to go to the SQL forum.
If I have misunderstood your meaning, please provide some simple sample data without privacy information and your desired output.
How to Get Your Question Answered Quickly
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
|---|---|
| 28 | |
| 26 | |
| 25 | |
| 20 | |
| 14 |
| User | Count |
|---|---|
| 53 | |
| 47 | |
| 22 | |
| 19 | |
| 18 |