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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.