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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
ovonel
Post Prodigy
Post Prodigy

value < 24 , not returning 0 values in DAX.

I have a DAX code where I am doing:

 

var Final1 = 
FILTER(
            SUMMARIZE(NextWeekCS,'Staffing'[DW_EK_Employee],'Date'[Week Year Week Number],"summ", SUM(Staffing[Hours])
            ),                       
                         [summ]<24
                         )

Var final = SUMMARIZE(final1, 'Staffing'[DW_EK_Employee])

 

But there is cases where the summ is 0, and my query is not retrieving those results:

I tend to think in a sql-way... is it correct to apply either?

  • [summ]<24 || [summ]=0
  • [summ]<24 || [summ] = BLANK()
  • [summ]<24 || [summ] is BLANK

Or shall I create a new/different summarize?

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @ovonel 

 

What do you expect the output to be? The final output of the Dax you have written is a table.

Table = 
SUMMARIZE (
    FILTER (
        SUMMARIZE (
            Staffing,
            'Staffing'[DW_EK_Employee],
            "summ", SUM ( Staffing[Hours] )
        ),
        [summ] < 24
    ),
    [summ]
)

vzhangti_0-1644830443407.png

Can you provide some data for testing? What do you expect the final result to look like and can you show it in a screenshot.

 

Best Regards,

Community Support Team _Charlotte

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
v-zhangti
Community Support
Community Support

Hi, @ovonel 

 

What do you expect the output to be? The final output of the Dax you have written is a table.

Table = 
SUMMARIZE (
    FILTER (
        SUMMARIZE (
            Staffing,
            'Staffing'[DW_EK_Employee],
            "summ", SUM ( Staffing[Hours] )
        ),
        [summ] < 24
    ),
    [summ]
)

vzhangti_0-1644830443407.png

Can you provide some data for testing? What do you expect the final result to look like and can you show it in a screenshot.

 

Best Regards,

Community Support Team _Charlotte

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

ValtteriN
Super User
Super User

Hi,

It is somewhat hard to judge this since I am not sure how much data you are dealing with, but I would go with the second option. Additionally depending on your end goal, I would use functions like SUMX in the second variable/ end result. e.g. if you want to have hours in a filter context SUMX(final1,[summ]) should be useful. Finally, these sort of iterative SUMMARIZE structures are rarely optimal and depending on your end goal it might be good to rethink your apporach.

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors