March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello,
I am struggling to get the same answer as the visual I created. I have data that shows order #s broken out by lines. When I create the filter to show orders greater than 250,000, it is filtering order lines by 250,000 and not the order itself. Examples
Order # | Line # | Amount |
1122 | 1 | 50000 |
1122 | 2 | 150000 |
1122 | 3 | 200000 |
1122 | 4 | 50000 |
2233 | 1 | 25000 |
2233 | 2 | 25000 |
Order 1122 is over 250,000 and order 2233 is not. However, when I filter by order #'s greater than 250,000, it will show none.
I finally went one step at a time and got to this
I made a visual with the same filters as the measure I created. The numbers come out the same.
I then go one step furter and ask it to group the table by order # and only shows orders over 250,000 and I get this
Once I try and add a measure to group the orders by 250,000, the numbers dont match. The visual is correct and I used the filters on the right and just threw the orders in the rows. In the filter on the visual, I said orders greater than 250000.
I can't for the life of me figure out what I am doing wrong.
Any help is appreciated.
Thanks!
Solved! Go to Solution.
hi @jwin2424
If its a single table and I have used the data which you shared and the numbers match.
I have uploaded pbix file here, please let me know once you have copied.
https://drive.google.com/file/d/1s5tjDp40tp__pTJnXc7tTfseMAIg2_F-/view?usp=sharing
The Left table is with filters applied with a simple SUM amount measure.
On the right is Table with measure.
hi @jwin2424 ,
Please use this measure, you need to add all the filters in FILTER as well as add these columns in SUMMARIZE.
THANK YOU!!!
That worked. However, can you help with ONE more thing?
Here is the DAX measure:
hi @jwin2424
I see a space before Unscheduled, please confirm if that is correct.
" Unscheduled"
I see that you have not included 'Backlog Reports'[PF] in Summarize which means that it will not be applied as filter when calculating this CALCULATE(SUM('Backlog Reports'[Ext Price-USD]))
The " Unscheduled" indeed has a space before the word. For sake of simplifying things, I wanted to show you just Q2+ 24 for this example:
When I leave out PF, I get the right number as the visual with the exact same filters.
When I add in PF, the numbers in the measure change.
I have also notived another weird thing with the power bi visual and the filters.
I have the fields Customer and Order # in the rows section of the visual with the power bi "Filters on this visual." When I remove Order # from the rows, the total changes.
The total $5,581,139 is the total I get when I create a pivot in excel with these same filters. I am not sure why adding or removing the order # is changing the result in the visual with the filters on the right. It doesn't affect the measure when i remove the order # (which is what I would expect).
hi @jwin2424
The problem lies with Measure, since PF has a <> operator, it means all values other than 2505, since one order no can have multiple line items and may be has different PF values, SUMMARIZE and @Sum will calculate sum at grup level and this group includes all the columns that are part of Summarize, so when you add PF total is incorrect.
Please try below measure and let me know. Also I am using single table, if you have multiple tables then it may require modification. Providing explanation with measure in screenshot.
This is driving me insane. I tried the above, and it isnt working. I have one table and no relationships. Let's see if this helps explain. I have created another single table with less data. Filters are same. You can see in both power bi and excel, when the filters are applied, the totals are the same. When I use the formula, I do not get the same answer.
When I add in the OR filter, nothing changes in the results.
And to show you what happens when I try the new formula you provided
It will not let me paste in my table (which is only 8500 characters) because it says I exceed the 20,0000 character limit for a post. I am going to try and post on a seperate reply.
EDIT: Maybe this will work
https://docs.google.com/spreadsheets/d/14-DlkOumQKKPTRgKVCWAtnfuGP62vUFZ7pESLZ9iOeM/edit?usp=sharing
I also created a measure for On ATP as follows:
hi @jwin2424
If its a single table and I have used the data which you shared and the numbers match.
I have uploaded pbix file here, please let me know once you have copied.
https://drive.google.com/file/d/1s5tjDp40tp__pTJnXc7tTfseMAIg2_F-/view?usp=sharing
The Left table is with filters applied with a simple SUM amount measure.
On the right is Table with measure.
I included the OR filter as well, and this worked. I did take out the REMOVEFILTERS () because I did have a date slicer on the page.
Thank you SO much for helping me! This will make a huge imapct for my report.
Hopefully this works. You can see the measure itself does not reflect the visual with the same filters applied
Hi @jwin2424
It's asking for my password at your company which I'm sure isn't what you wanted.
You'll have to upload your pbix file to OneDrive, GoogleDrive, WeTransfer, or Dropbox and copy the link. Remember to give necessary permissions if required.
Uuuhg looks like my company blocked uploads from those sites. I used to be able to do it from one drive, but for some reason it asked you for a PW. It hasn't done that in the past.
Best I can do is just the visual
The measure results in the above total.
The filters on the visual result in this total. I just want a measure that replicates the filters on the right.
Not sure why it is capturing these orders
Would it help to change your variable declaration to something like this?
VAR FilteredOrders =
SELECTCOLUMNS(
FILTER(
ADDCOLUMNS(
VALUES( 'Sheet1'[Order # 2] ),
"_sales",
CALCULATE( SUM( 'Sheet1'[Ext Price-USD] ) )
),
[_sales] > 250000
),
"Order # 2",
[Order # 2]
)
Unfortunately, this yielded the same result as mine.
Hi @jwin2424
With a measure like this, you should be able to filter orders over 250K.
Filter Orders over 250K =
VAR _OrderSales =
CALCULATE(
SUM( 'Table'[Amount] ),
ALLEXCEPT(
'Table',
'Table'[Order #]
)
)
VAR _Result =
IF(
_OrderSales > 250000,
1,
0
)
RETURN
_Result
I hope I understood correctly.
Group order lines then apply filters.pbix
Unfortunately that does not work. I need a measure that fulfills these filters.
Where I am struggling is grouping the data by the order # so that the measure applies the filters to order #s over 250000. Right now, it is calculating row by row, and the order #'s are broken down by line #'s. I need the order # to be grouped into one distinct order # THEN apply the remaining filters.
Hi @jwin2424
Is there any way you could come up with a pbix with sample data that covers this issue including the columns to be used as filters ?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
25 | |
18 | |
15 | |
9 | |
8 |
User | Count |
---|---|
37 | |
32 | |
18 | |
16 | |
13 |