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

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.

Reply
VALMITZI
New Member

besoin d'aide : compter des lignes et en tirer un ratio

Bonjour à tous,

Voilà ce que je fais dans Excel, et je ne trouve pas comment le reproduire dans Power BI :

Je compte le nombre de valeurs B2B/B2C à l'aide d'un tcd :

VALMITZI_2-1667916664776.png

 

 

et je fais un second tcd sur le 1er, pour en tirer un poids :

VALMITZI_1-1667916590185.png

 

dans Power BI, je parviens à reproduire la 1ère étape, mais je ne parviens pas à calculer les % :

VALMITZI_3-1667916773714.png

 

un grand merci pour votre aide

 

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi, @VALMITZI ;

Try to create a measure.

measure =
DIVIDE (
    CALCULATE ( COUNT ( [B2B/B2C] ), 'table'[B2B/B2C] = "B2B" ),
    CALCULATE ( COUNT ( [B2B/B2C] ), 'table'[B2B/B2C] = "B2C" )
)

Then add matrix visual in powerbi desktop.

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you. 
Solved: How to upload PBI in Community - Microsoft Power BI Community


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello and thank you very much for your help !

Alas the solution does not work because I need to count aggregate crosses in my table. You can see that my table has several rows of movements concatenated on one row in my pivot table as follows:

 

VALMITZI_0-1668010500373.png

 

 

VALMITZI_1-1668010500375.png

 

 

the expected calculated result is this :

VALMITZI_2-1668010500376.png

 

VALMITZI_4-1668011184905.png

Thank you very much !

 

 

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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