Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello Everyone,
I'm relatively new to Power BI and I was hoping for some assistance.
I'm attempting to write a measure that filters a line graph to only show items where the Quantity does not change over the selected timeframe.
This is my current measure
When I apply this measure to a card visual, it correctly displays a value of "1" if the item quantity has not changed during the selected timeframe and a Value of "0" if the value has changed.
In the above example, I have "Zebra Printer Shoulder Strap" selected and the quantity remains at 217 over the course of the selected timeline.
When I attempt to add that same measure to the line graph as a visual level filter and set it to "Show items when the value = 1", it does not actually filter the visual to only show items where the quanitity has not changed as shown below.
These are the relationships that I have applied.
Example PBIX file Example Data.zip
Any help would be appreciated.
Solved! Go to Solution.
Hi @Anima ,
Please change the DAX into this:
Zones Stagnate Items =
VAR SelectedStartDate = MINX(FILTER(ALLSELECTED('Zones Historical Inventory'),[PartNumber] in VALUES('Zones Historical Inventory'[PartNumber])),[Date])
VAR SelectedEndDate = MAXX(FILTER(ALLSELECTED('Zones Historical Inventory'),[PartNumber] in VALUES('Zones Historical Inventory'[PartNumber])),[Date])
VAR StartDateQuantity =
CALCULATE(
SUM('Zones Historical Inventory'[OnHand]),
'Zones Historical Inventory'[Date] = SelectedStartDate
)
VAR EndDateQuantity =
CALCULATE(
SUM('Zones Historical Inventory'[OnHand]),
'Zones Historical Inventory'[Date] = SelectedEndDate
)
VAR Difference = EndDateQuantity - StartDateQuantity
RETURN
IF(Difference = 0, 1, 0)
And the final output is as below:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anima ,
Please change the DAX into this:
Zones Stagnate Items =
VAR SelectedStartDate = MINX(FILTER(ALLSELECTED('Zones Historical Inventory'),[PartNumber] in VALUES('Zones Historical Inventory'[PartNumber])),[Date])
VAR SelectedEndDate = MAXX(FILTER(ALLSELECTED('Zones Historical Inventory'),[PartNumber] in VALUES('Zones Historical Inventory'[PartNumber])),[Date])
VAR StartDateQuantity =
CALCULATE(
SUM('Zones Historical Inventory'[OnHand]),
'Zones Historical Inventory'[Date] = SelectedStartDate
)
VAR EndDateQuantity =
CALCULATE(
SUM('Zones Historical Inventory'[OnHand]),
'Zones Historical Inventory'[Date] = SelectedEndDate
)
VAR Difference = EndDateQuantity - StartDateQuantity
RETURN
IF(Difference = 0, 1, 0)
And the final output is as below:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you for the assistance.
I ended up figuring out a solution that involves creating a calculated column.
This is the DAX that I have set for my calculated column. It checks the Part Number + Inventory Owner and then compares the On Hand quantity values against any other instance of that same Part Number + Inventory Owner and if the On Hand quantity has changed, it returns 1 else 0.
I applied this calculated column as a visual level filter to my line graph and then set the filter value to " Is = 0" and that filtered my line graph to show only items where the quantity doesn't change.
While this specific route doesn't account for date changes, It does allow me to present this data in other types of visuals, so I'm going to keep messing around with the solution you provided and this one.
Thanks again for your assistance.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 60 | |
| 43 | |
| 40 | |
| 37 | |
| 21 |
| User | Count |
|---|---|
| 178 | |
| 127 | |
| 115 | |
| 77 | |
| 54 |