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.
Hello,
I’m new to Power BI and I can’t find out how to solve this problem.
I have the following database – called fCustodia.
I need to calculate the % of shares of an investor per day for each type of share (there are 2 types of shares – “BDR” and “LUX”).
The first % I manage to calculate through a column. When I try to do the same for the second type, I get an error (“A circular dependency was detected”).
I understand I need to solve the problem by creating a measure. But how do I calculate a % per investor per day?
I was trying something like below:
% LUX = SUMX(fCustodia;fCustodia[Shares])/SUMX(filter(fCustodia;fCustodia[Date]=EARLIER([Date]));fCustodia[Shares])
I need the denominator to be sum of the shares of that day, not the total of shares of the database.
Many thanks,
Mirele
Hi @mirele_aragao.
You can try to use below formula to calculate per day percent, it also allow filter on it.
% LUX = VAR temp = ALLSELECTED ( fCustodia ) RETURN DIVIDE ( SUMX ( FILTER ( temp, [Date] = MAX ( [Date] ) ), [Shares] ), SUMX ( temp, [Shares] ), 0 )
Notice: this formula not work properly on total row.
Regards,
Xiaoxin Sheng
I think that you could just create a Table visualization and add Date and Type and then Shares. You should then be able to click on the little down arrow for Shares and chose "Show value as" and then "Percent of grand total".
It works if I'm showing a general overview of the data. However if I filter by types of investors, for example, then it recalculates and shows a wrong %
Covering 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 |
---|---|
112 | |
97 | |
85 | |
67 | |
59 |
User | Count |
---|---|
150 | |
120 | |
100 | |
87 | |
68 |