The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi all,
I created a solution to bring in the last 4 sprints based on the selection, exactly as explained by Alberto Ferrari in the link below:
https://www.sqlbi.com/articles/show-previous-6-months-of-data-from-single-slicer-selection/
Things worked fine, but I'm facing a situation.
The result below is what I got, but notice that I don't have data for Sprint 20 and I would like 0 to be returned in this case:
I tried to add 0 to my measure, but this made the values of the other sprints that shouldn't appear, start to appear with the value 0.
As I have the Sprint 21 selected, it should appear only Sprints 18, 19, 20 and 21.
The result I expect is this, but how to do it dinamically, I didn't find a solution:
I tried a way to find the minimum value of my sprint that appears in my chart (in my case, with the selection in sprint 21, it should get sprint 18), so I could use that as a filter, but I didn't find a way to reach this value.
Link to the file: https://1drv.ms/u/s!At5JlMR_naI1gf4xP2uHwDmcf3fgcA?e=M5cme9
Thanks for your help!
Solved! Go to Solution.
Hi @lcfaria,
could you try writing your measure like this:
Sum Value = var _tmp = SUM('fact'[Value])
var _sprint = CALCULATE(SELECTEDVALUE('calendar'[Sprint]))
return
_tmp + IF(NOT(ISBLANK(_sprint)),0,BLANK())
cheers,
Sturla
Hi @lcfaria,
could you try writing your measure like this:
Sum Value = var _tmp = SUM('fact'[Value])
var _sprint = CALCULATE(SELECTEDVALUE('calendar'[Sprint]))
return
_tmp + IF(NOT(ISBLANK(_sprint)),0,BLANK())
cheers,
Sturla