The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
My test model looks like this
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.
@Anonymous Do you mean to use the HASONEVALUE() function perhaps instead of HASONEFILTER ?
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
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?
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.
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.
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.
User | Count |
---|---|
75 | |
70 | |
39 | |
30 | |
28 |
User | Count |
---|---|
104 | |
95 | |
51 | |
48 | |
46 |