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
Anonymous
Not applicable

Measure with HASONEFILTER will break my dimension table to not work

Hi,
Can someone explain for me why my filtering from my dimension table stops working when I add this measure to a table.

The Measure

tobiasnygren_0-1649746412554.png

My test model looks like this

tobiasnygren_1-1649746473335.png

And if I try to filter on the Rowtype in the dimension table in the report, with the measure in a table, the table will not filter.
And the table below without the measure till filter as wanted.

tobiasnygren_2-1649746879494.png

 



6 REPLIES 6
AllisonKennedy
Super User
Super User

@Anonymous  Do you mean to use the HASONEVALUE() function perhaps instead of HASONEFILTER ?


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Anonymous
Not applicable

What I'm trying to solve with this is the total row for a measure but you do not see it in my example. 
I'm diffing some times per incident and the diff is correct on the rows but the total get wrong.
So I tried to do something like this example to solve it.
https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

But I noticed that my dimension table stoped filtering the fact table when I added the measure to my visual.
And I don't understand why. If I add the rowtype on the fact table and filter it's working, but not when using my dimension table.

Hi @Anonymous 

 

From your screenshot, at present the measure "Test HasOneFilter" is returning the correct result but I'm not sure whether it is the expected result you want. And in below image, there is a filter setting to choose "Incident Header", what is it? 

vjingzhang_0-1649994207781.png

 

I think perhaps you can forget this "HasOneFilter" problem temporarily since your purpose is to solve a total row problem for a measure. There are several ways to deal with the total row. "HasOneFilter" is not a must. We can use other functions instead according to different models and visuals. Here are videos which introduce some solutions to fix incorrect total problems. They use a mode like SUMX(VALUES('Table'[CoIumn]),[Row Measure])

How to Fix Incorrect DAX Measure Totals and What Causes Them - YouTube

DAX Fridays! #25: Wrong Grand Totals in Power BI - YouTube

 

If you still need help, please share some sample data&output or a demo pbix. Data can explain more and we can try to provide a more accurate solution based on that.

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Anonymous
Not applicable

PBI example file 
Data Excel 

Here is one example file.
It looks like it is working here but I think something is wrong.
When I use the measures in my normal model that is quite big with more than 30 miljon of rows it is not working good.

Looks like it's a performance problem when I have both
"Installation" and "The average column when I diff the times" in the visual.

If I for example remove the "installation" column and only have the  average it is working.
If I remove the average and have the installation column it is also working.

If I check the dax query in dax studio, I do not understand why I get this full query on installations.
It also says it is 6 rows but I only have 3 installations in that dimension table.

tobiasnygren_0-1650533344192.png

 

Anonymous
Not applicable

I have noticed this when running DAX studio for my model.
Why will
[measure] = DATEDIFF([TIME1],[TIME2],SECOND)
scan extra rows
compared with just [measure] = [Time2]-[TIME1]

See my pictures from dax studio.
 

tobiasnygren_0-1650629873834.pngtobiasnygren_1-1650629931428.png

 

 

amitchandak
Super User
Super User

@Anonymous , what are you trying to achieve here?

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.