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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
kressb
Helper V
Helper V

HASONEFILTER not working - suggestions?

I have four tables:

Table 1 - Sites, Groups (Site 1, Site 2 = Group A, etc), connected to Table 2 & Table 3

Table 2 - Maximum # for Site by day

Table 3 - Total # done for Site by day

Table 4 - Date Dimension, connected to Table 2 & Table 3

Tables.png

The data tables are by Site. I'm making a summary table by Group that counts # of days at max and over max.

GroupSummaryTable.png

I have the table completed, but I can't get the Total Line to reflect correctly for At Max/Over Max.

For Over Max, I am using:

If(HASONEFILTER(Table1[Group]),
  SumX(DateDimension,
                                     Calculate(IF(
                                                        SUM(Table3[Total])-Sum(Table2[Max])>0,
                                                        Count(DateDimension[Date]))),
Sumx(Filter(Table1,SUM(Table3[Total])-Sum(Table2[Max])>0),
          Count(DateDimension[Date])))

Instead of the 2 in yellow above, I just get a blank.. anyone willing to throw out some ideas as to why?

1 ACCEPTED SOLUTION

@kressb Fairly certain that should be HASONEVALUE.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
kressb
Helper V
Helper V

@Greg_Deckler I believe I got this HASONEFILTER formula from you, any idea why it wouldn't work to count dates?

@kressb Fairly certain that should be HASONEVALUE.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Picture2.png

 

At Max: =
SUMX (
VALUES ( Table1[Group] ),
CALCULATE ( IF ( SUM ( Table2[Max] ) = SUM ( Table3[Total] ), 1, 0 ) )
)
 
Over Max: =
SUMX (
VALUES ( Table1[Group] ),
CALCULATE ( IF ( SUM ( Table2[Max] ) < SUM ( Table3[Total] ), 1, 0 ) )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

@Jihwan_Kim thanks for responding.

This is by individual day - every single day of the year - so that formula won't work.
The formula i have does work, for everything except for returning a total.

any other ideas?

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.

Top Solution Authors