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.
Hello.
I would like some help with regards to the following %NS measure. %NS measure is a division of Accounts Value per Netsales. I want to create the first table and instead I am getting the second. The %NS for GMI is calculated correctly but appears only under Total and in the GMI row I am getting 0%. Please find below the measure that I have created. Any advice will be really appreciated. Thanks in advance.
%NS PER =
VAR Netsales= CALCULATE (
SUMX(Table;Table[Value]);
FILTER(Table;Table[Account]="Net Sales");REMOVEFILTERS(Table[Account]))
Var GMI= CALCULATE (
SUMX(Table;Table[Value]);
FILTER(Table;Table[Account]="GMI");REMOVEFILTERS(Table[Account]))
RETURN
DIVIDE(GMI;Netsales;0)
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
Actuals measure: =
SUM( 'Table'[Actuals] )
Percent Netsales: =
VAR _netsales =
CALCULATE (
[Actuals measure:],
FILTER ( ALL ( 'Table' ), 'Table'[Account] = "Netsales" )
)
VAR _actuals = [Actuals measure:]
RETURN
IF ( HASONEVALUE ( 'Table'[Account] ), DIVIDE ( _actuals, _netsales ) )
Hi, Thanks for the answer but it is not working for my model. I have simplified it and provided only one table but I have a Date table and Account as well that are connected with my Table. I have tried to adapt your solution and instead of ALL, used ALLSELECTED as I want my table to get updated according to user selection-filters on Info (monthly values or not), Year and Month. As you can see below the problem is now that is working only for Netsales and not for the rest Accounts. Moreover, in contrast with your Netsales my Netsales are only being calculated for Account =Netsales but wanted to get the same Netsales value in all rows. I have attached my new variable along with the result that it brings back. Any help will be much appreciated.
Hi,
Please share your pbix file's link, and then I can try to look into it.
Thanks.
@Anonymous , try like
%NS PER =
VAR Netsales= CALCULATE (
SUMX(Table;Table[Value]);
FILTER(all(Table[Account]) ;Table[Account]="Net Sales"))
Var GMI= CALCULATE (
SUMX(Table;Table[Value]);
FILTER(all(Table[Account]);Table[Account]="GMI"))
RETURN
DIVIDE(GMI;Netsales;0)
If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.