Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
KotaroNoguchi
New Member

How to make DAX fomula

I created the following DAX code.
But can't be completed.
Error indication "reached the end of input".
What's the problem?
-----------------------------------------------------------------------
rikei =
VAR CurrentDate = SELECTEDVALUE('Table'[Date])
VAR CurrentShot = SELECTEDVALUE('Table'[Shot])
VAR FilteredTable =
    FILTER(
        ALL('Table'),
        'Table'[Sensor] = "XXX" &&
        'Table'[Date] = CurrentDate &&
        'Table'[Shot] = CurrentShot &&
        'Table'[Value] > 20
    )
VAR FirstExceedingRow =
    TOPN(
        1,
        FilteredTable,
        'Table'[Time[s]],
        ASC
    )
VAR ResultTime =
    MINX(
        FirstExceedingRow,
        'Table'[Time[s]]
    )
RETURN
    IF(
        ISBLANK(ResultTime),
        BLANK(),
        ResultTime + 10
    )
-----------------------------------------------------------------------
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @KotaroNoguchi ,

As @gmsamborn  said, I think you can change the column name of the Time[s] column.

I create a table as you mentioned.

vyilongmsft_0-1721628774525.png

Then I use the DAX code below and it gives me the same error message.

vyilongmsft_1-1721628863145.png

One way is that you can apply the content of the tips it gives.

vyilongmsft_2-1721629001013.png

vyilongmsft_3-1721629203239.png

Another way is that you can change the name of your column.

vyilongmsft_4-1721629436120.png

 

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @KotaroNoguchi ,

As @gmsamborn  said, I think you can change the column name of the Time[s] column.

I create a table as you mentioned.

vyilongmsft_0-1721628774525.png

Then I use the DAX code below and it gives me the same error message.

vyilongmsft_1-1721628863145.png

One way is that you can apply the content of the tips it gives.

vyilongmsft_2-1721629001013.png

vyilongmsft_3-1721629203239.png

Another way is that you can change the name of your column.

vyilongmsft_4-1721629436120.png

 

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

gmsamborn
Super User
Super User

Hi @KotaroNoguchi 

 

The problem seems to be with your column name "Time[s]".  If you substitute [ and ] with ( and ) in your column name, then daxformatter.com will format it.

 

ie. Replace    'Table'[Time[s]]   with    'Table'[Time(s)]

 

Let me know if you have any questions.

 



Proud to be a Super User!

daxformatter.com makes life EASIER!

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.