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

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

Reply
Cyanure14
Regular Visitor

Obtenir le nom de la catégorie avec le chiffre d'affaires le plus important

Bonjour à tous,

 

Je fais des tests sur PBI et je travaille avec une base de données de vente de vélos. Pour faire court, je souhaiterais afficher dans un visuel type "carte" le nom de la categorie de vélo avec le plus gros chiffres d'affaires sur la période filtrée. En ce qui concerne le filtre de la période je n'ai pas de problématique par contre je n'arrive pas à trouver comment affiher le nom de la categorie avec le plus gros chiffres d'affaires. J'ai réussi à gnérer une mesure me donnant le CA de la categorie de vélos avec le plus gros chiffres d'affaires ce qui est déja une étape, mais j'aimerais générer le nom de la categorie concernée. Si qq a la petite astuce, je suis preneuse 🙂

 

Cyanure14_0-1727784396773.png

 

1 ACCEPTED SOLUTION
v-yaningy-msft
Community Support
Community Support

Hi, @Cyanure14 

Thanks for lbendlin's reply. You can use a dynamic title to display the maximum bike sale value

vyaningymsft_0-1727854813393.png

 

Dynamic title = 
VAR _maxSales =
    CALCULATE (
        [Max Cumulative value by category],
        ALLEXCEPT ( Sales, Sales[Category] )
    )
VAR _category =
    CALCULATE (
        MAX ( Sales[Category] ),
        FILTER ( Sales, [Max Cumulative value by category] = _maxSales ),
        ALL ()
    )
RETURN
    _category


Cumulative value by category = 
CALCULATE ( SUM ( Sales[SalesValue] ), ALLEXCEPT ( Sales, Sales[Category] ) )

Max Cumulative value by category = 
MAXX ( Sales, [Cumulative value by category] )

 

Best Regards,
Yang

Community Support Team

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

4 REPLIES 4
v-yaningy-msft
Community Support
Community Support

Hi, @Cyanure14 

Thanks for lbendlin's reply. You can use a dynamic title to display the maximum bike sale value

vyaningymsft_0-1727854813393.png

 

Dynamic title = 
VAR _maxSales =
    CALCULATE (
        [Max Cumulative value by category],
        ALLEXCEPT ( Sales, Sales[Category] )
    )
VAR _category =
    CALCULATE (
        MAX ( Sales[Category] ),
        FILTER ( Sales, [Max Cumulative value by category] = _maxSales ),
        ALL ()
    )
RETURN
    _category


Cumulative value by category = 
CALCULATE ( SUM ( Sales[SalesValue] ), ALLEXCEPT ( Sales, Sales[Category] ) )

Max Cumulative value by category = 
MAXX ( Sales, [Cumulative value by category] )

 

Best Regards,
Yang

Community Support Team

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Super! Cela fonctionne très bien 🙂

Merci pour le temps accordé à me transmettre une solution viable 🙂

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information. Do not include anything that is unrelated to the issue or question.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Bonjour,

 

La capture d'écran ne fait qu'illustrer mon problème mais ne sert pas à grand chose en l'état. Les données representées sont des données fictives donc tout va bien.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

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.