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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.