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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
marcss44
Regular Visitor

Getting some measures from Count Distinct with two row header fields

Hi friends!

I've got a Matrix with two row headers fields and i need to get the result of divide one columm by another (Both are distinct count fields). For example:

 

marcss44_0-1721798721843.png

 

In green the two row header fields, and i need to obtain the division of 8 by 49883 and 3 by 4988

 

1 ACCEPTED SOLUTION

Hi @marcss44 

 

Here is the report back with the measures https://drive.google.com/file/d/1j6eHxkYc6gBObIRkU3jd218izWoEa_7r/view?usp=sharing

Joe_Barry_0-1721823607531.png

Joe







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

Proud to be a Super User!





Learn about the Star Schema, it will solve many issues in Power BI!

Date tables help! Learn more



LinkedIn
Let's connect on LinkedIn


View solution in original post

7 REPLIES 7
Joe_Barry
Super User
Super User

Ok, can you share a sample of your data with all column names visible?




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

Proud to be a Super User!





Learn about the Star Schema, it will solve many issues in Power BI!

Date tables help! Learn more



LinkedIn
Let's connect on LinkedIn


Hi @marcss44 

 

Here is the report back with the measures https://drive.google.com/file/d/1j6eHxkYc6gBObIRkU3jd218izWoEa_7r/view?usp=sharing

Joe_Barry_0-1721823607531.png

Joe







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

Proud to be a Super User!





Learn about the Star Schema, it will solve many issues in Power BI!

Date tables help! Learn more



LinkedIn
Let's connect on LinkedIn


Joe_Barry
Super User
Super User

Hi @marcss44 

 

I will presume that 3 by 4988 should be 3 by 49883?

 

Lets create some measures to get the sum of each column

 

 

IDS Total = SUM(TABLE[IDS TOTAL])

 

 

 

ID SCRAP = SUM(Table[ID SCRAP])

 

 

We will now create a measure that gets the Total of IDS Total that removes filters.

 

IDS Total - All =
CALCULATE([IDS Total], /// we use the first measure
ALLEXCEPT(Table[Familia])
)

 

Now lets calculate the division

 

% of IDS Total =
DIVIDE([ID SCRAP], [IDS Total], 0)

 

 

Convert to % if needed

 

Joe




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

Proud to be a Super User!





Learn about the Star Schema, it will solve many issues in Power BI!

Date tables help! Learn more



LinkedIn
Let's connect on LinkedIn


This part is not working:

 

IDS Total - All =
CALCULATE([IDS Total], /// we use the first measure
ALLEXCEPT(Table[Familia])
)

 

The ALLEXCEPT says: Not enought arguments...

Sorrry my mistake, It should work with this now

IDS Total - All = 
CALCULATE([IDS Total], /// we use the first measure
ALL('Table'))

 

 




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

Proud to be a Super User!





Learn about the Star Schema, it will solve many issues in Power BI!

Date tables help! Learn more



LinkedIn
Let's connect on LinkedIn


No, is not working:

 

marcss44_0-1721801536507.png

 

 

8/49883 it shows 100%

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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