Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
It is clear that the linked [Price Now] measure from the dimension table ('Current Prices and Yields') is causing all these invalid rows to be generated. Here is the measure formula I've used, which features the HASONEVALUE expression to suppress a summed total in the price field.
Price Now =
I read a post that hinted to a possible solution wherein the VAR and IF expressions could be used to require blank prices in any row where the quantity is blank, but what concerns me is my lack of understanding the logic that is driving the linked price to generate all these rows. If I've erred in creating the formula, I'm hoping there is a simpler solution.
Many thanks
Bill
Symbol | Description | Quantity | Price Now | Value Now | Amount Invested | Total Gain/Loss |
04109KDC8 | ARKANSAS ST DEV FIN AUTH CAP IMPT REV, REVOLVING LN FD REV BDS, SER 2011C | $ 300 | $ 101.70 | $ 30,510 | $ 30,006 | $ 504 |
Rendering WITH drilldown
Symbol | Account | Purchase Date | Description | Quantity | Price Now | Value Now | Amount Invested | Total Gain/Loss |
04109KDC8 | ||||||||
AcctXYZ | ||||||||
1/13/2012 | $ 101.70 | |||||||
10/16/2012 | $ 101.70 | |||||||
10/18/2010 | $ 101.70 | |||||||
11/21/2011 | ARKANSAS ST DEV FIN AUTH CAP IMPT REV, REVOLVING LN FD REV BDS, SER 2011C | $ 300 | $ 101.70 | $ 30,510 | $ 30,006 | $ 504 | ||
12/1/2005 | $ 101.70 | |||||||
12/15/2011 | $ 101.70 | |||||||
12/5/2011 | $ 101.70 | |||||||
2/8/2017 | $ 101.70 | |||||||
3/24/2016 | $ 101.70 | |||||||
3/6/2015 | $ 101.70 | |||||||
3/9/2012 | $ 101.70 | |||||||
5/2/2018 | $ 101.70 | |||||||
5/8/2013 | $ 101.70 |
Solved! Go to Solution.
Hi @Anonymous ,
Withouth an example of you data model it's difficult to pin point your error however if you look at the formula what you are using is the following:
HASONEVALUE('Current Prices and Yields'[Price]) - Check if there is a single value for the Price column
VALUES('Current Prices and Yields'[Price])) - Returns the price column when there is a single value for the price formula
Otherwise blank
So looking in attention what you are returning is if the Price exist return a price otherwise return blank, what is happening is that probably in the way you have setup your data since there is a price related with all those dates and accounts you will get a value.
I assume you don't want nothing if there is no transactions correct?
I would do a differente calculation something similar to this:
Price Now =
IF(Sum(Table[Quantity])= BLANK(),BLANK(),VALUES('Current Prices and Yields'[Price]))
Try it and let me know if it works.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsIndeed this did the trick.... thank you very much 🙂
Hi @Anonymous ,
Withouth an example of you data model it's difficult to pin point your error however if you look at the formula what you are using is the following:
HASONEVALUE('Current Prices and Yields'[Price]) - Check if there is a single value for the Price column
VALUES('Current Prices and Yields'[Price])) - Returns the price column when there is a single value for the price formula
Otherwise blank
So looking in attention what you are returning is if the Price exist return a price otherwise return blank, what is happening is that probably in the way you have setup your data since there is a price related with all those dates and accounts you will get a value.
I assume you don't want nothing if there is no transactions correct?
I would do a differente calculation something similar to this:
Price Now =
IF(Sum(Table[Quantity])= BLANK(),BLANK(),VALUES('Current Prices and Yields'[Price]))
Try it and let me know if it works.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsCovering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
105 | |
88 | |
73 | |
66 |
User | Count |
---|---|
124 | |
113 | |
98 | |
81 | |
72 |