Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I have a line graph where I used the plus zero trick to make the line hit zero where there is a null, but now my line graph has a bunch of lines that just have zero throughout. Those need to go away and only keep the values if there was a value greater than zero at least once in the date range. The table to the left is what I'd like to keep in the line graph on the right. It filters on the realized qty > 0, which won't work on the graph, because I'll get dots on the line graph where they actually should be hitting zero.
I'm connected to a cube so creating new columns isn't an option. I appreciate any help on the matter!
Edit: The defintion for Realized Qty is
Solved! Go to Solution.
@Anonymous I still think my proposed solution would work.
I've tested it with your data file (note I filtered out R101-6 because it was really skewing the axis).
The TotalRealizedQty measure was as follows:
TotalRealizedQty =
CALCULATE ( SUM ( data[Realized Qty] ), REMOVEFILTERS ( data[Level 3] ) )
I figured it out! I changed the removefilters function to pass the entire date table and not just the column and everything worked!
You definitely paved the way for this!
Hi duncanh,
maybe the followings helps. Its a workaround but it might help to solve your challenge.
I created some dummy data and wrote a measure which checks the sum of all values while ignoring only the colum which is used as the x-axis. If the sum is not zero then there are non zero values so I show the value. if the sum is zero then I put in BLANK() so that the value will not be shown as a graph
Hey thanks for the reply, but your solution looks exactly like just filtering by the measure on my cube. I think my measure definition for Realized Qty is throwing everything off. Here's what it looks like:
@Anonymous here is a blog post that I would highly recommend to go over and understand how this PQ works. it will surely pay off in long run.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@Anonymous it is not as easy as you expect because you want to control for each proditemno.
so this is what needs to happens:
- check if prodline has sales across all the selected periods, if no then return blank() because we don't want to see that product line at all with zero at the bottom
- check if prodline has sales then get the maximum period (either across all the product lines or that specific product line) and
- finally give the maximum period for that product, anything before that will be zero or whatever period value
It is pretty doable, throw sample data in a pbix file and I will put the measures together.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Thanks. Here is a link: test.pbix - Google Drive
I just pasted the table data and scrambled the values.
Just to be clear, Proditemno = 276OKC1 can show zeros since it has a non-zero value but 287ICT1 shouldn't show up anywhere on this graph at all.
@Anonymous one potential method would be to create a seperate measure specifically for filtering, which calculates the total "Realized Quantity".
For example:
TotalRealizedQty =
CALCULATE(
SUM('Table'[Realized Qty]),
REMOVEFILTERS('DateTable'[MONTH]
))
Then filter the visual using the measure "TotalRealizedQty" > 0
Darn I had high hopes for this one. I get the following results, which is the same as filtering by my original measure. Those dots need to go to zero when there isn't data, like in my original graph.
What I think will work is a measure like
but that aggregates over ProdItemNo, and then filtering on that. I just don't know how to write it.
@Anonymous I still think my proposed solution would work.
I've tested it with your data file (note I filtered out R101-6 because it was really skewing the axis).
The TotalRealizedQty measure was as follows:
TotalRealizedQty =
CALCULATE ( SUM ( data[Realized Qty] ), REMOVEFILTERS ( data[Level 3] ) )
I figured it out! I changed the removefilters function to pass the entire date table and not just the column and everything worked!
You definitely paved the way for this!
I'm sharing my original measure definition for Realized Qty. I think that is what is throwing everything off:
Yes that is exactly the outcome that I need. Maybe it was the transition of the extracted data, but going against my cube, I still get this and your measure doesn't work. The measure logic is visible at the top. Those dots need to hit zero:
@Anonymous find the maximum period in your table and then fix the measure to no go beyond the maximum period.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
I know what you are saying, but that wont solve the issue with period 1 -7 that have the zero lines as well.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 45 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 64 | |
| 32 | |
| 31 | |
| 27 |