Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
chonchar
Helper V
Helper V

Divide/ % of Total

Good morning. @parry2k @MFelix 

I had the below measure working until I had to update a connection. But now, this measure is returning 100% for all screens:

 

% of Total Screens =
Var _totaldomains=
CALCULATE(
    [Total Screens per Domain], // this is a measure that is working correctly. 
    ALL(Appended_Fiscals[Domain]))
return
DIVIDE(
    [Total Screens per Domain],
     _totaldomains,0
    )// now that I look at this, it makes sense that it is returning 100% for all, becasue it is basicaly 1/1=1
 
In my new model (same measure as above, same data) is returning the below. 
 
chonchar_1-1698931023305.png

 

 
But it worked in my previous model and was returning this. 
.chonchar_2-1698931086883.png
 
The above is my expected output. 
 
Any help would be appreciated. Thank you. 

 

 

1 ACCEPTED SOLUTION

Or visualization because this measure should give you the same value in all the rows.

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

18 REPLIES 18
MFelix
Super User
Super User

Hi @chonchar ,

 

What type of connection was updated? It seems like you  [Total Screens per Domain] is exactly the same thing has 

CALCULATE(
    [Total Screens per Domain], // this is a measure that is working correctly. 
    ALL(Appended_Fiscals[Domain]))

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



@MFelix I connectd a table to a SharePoint site that was previously on my desktop, so I had to redo all the measures to locate the new table (it was named something slightly different).

 

And you are correct, the measures are the same which is why it's basically giving me 1/1=1.

 

Maybe you could help me rewrite it? 

rajulshah
Super User
Super User

@chonchar 

 

You can do one thing. You can create 2 different measures for numerator and denominator and then debug these measures individually.

 

Please let me know if this doesn't help.

@rajulshah I just tried that and it is still returning 100%. This is the strangest thing.

@chonchar 

Did you validate if the relationships are working or not?

@rajulshah The relationships are working. The new table is the exact same as the old with a 1:M relationship. 

@chonchar Can you try using ALL on the table itself?

@rajulshah All is already on the table itself:

chonchar_0-1698935538008.png

 It is still returning 1

Can you share the calculation for the [Total Screens per Domain] please


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



@MFelix 

Total Screens per Domain =
COUNTAX(
    Appended_Fiscals,
    Appended_Fiscals[Domain]
)

The formula should not retrieve the same value, it should return a different value since using the ALL statement removes the row context.

 

You are using the Domain on your table correct?


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



@MFelix Correct. All of the Domains are listed in the (Appended_FiscalsTable). The column name is Domain. 

The Domain is being brought in from the primary key table with 

Domain =
RELATED(User_MasterSP[Domain]
)
 
But the % of total calculation is only using the (appended_fiscals) table 

Check if the result for the below part of the code returns the same value for every row if not then is a model issue or a context in your table.

CALCULATE(
    [Total Screens per Domain], // this is a measure that is working correctly. 
    ALL(Appended_Fiscals[Domain]))

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



@MFelix 
Model issue?

chonchar_0-1698937023960.png

 

Or visualization because this measure should give you the same value in all the rows.

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



@chonchar ,

 

where you abble to see what was incorrect?

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



@MFelix 
I was unable to fix it. But it must be a model issue. I confirmed with someone in my firm and he said the same thing. I have to present at 2pm MST so I am just going to leave the column out for now. 

If yopu need assistance can you please share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.

If the information is sensitive please share it trough private message.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.