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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
huguo_90
Regular Visitor

I want to calculate the price of a product in percentage with previous month and quater

Bonjour

Je veux calculer le prix d’un produit en pourcentage par rapport au mois précédent et par rapport au trimestre précédent. Mais le résultat donne une mesure vide dans le plat sur un visuel. Est-ce normal ?

J’ai une relation de plusieurs à 1 entre ma table et la table du calendrier.

Voici les formules utilisées. Merci d’avance pour votre aide.

TEST_3MONTH = DIVIDE(SUM(TEST[Prix])-CALCULATE(SUM(TEST[Prix]),PREVIOUSQUARTER('Calendrier'[Date])),CALCULATE(SUM(TEST[Prix]),PREVIOUSQUARTER( 'Calendrier'[Date])))

 

et

 

TEST_1MONTH = DIVIDE(SUM(TEST[Prix])-CALCULATE(SUM(TEST[Prix]),PREVIOUSMONTH('Calendrier'[Date])),CALCULATE(SUM(TEST[Prix]),PREVIOUSMONTH('Calendrier'[Date])))

1 REPLY 1
v-xinruzhu-msft
Community Support
Community Support

Hi @huguo_90 

You can try the following measures

TEST_1MONTH = var a=SUM(TEST[Prix])
return IF(a<>BLANK(),DIVIDE(SUM(TEST[Prix])-CALCULATE(SUM(TEST[Prix]),PREVIOUSMONTH(Calendrier[Date])),CALCULATE(SUM(TEST[Prix]),PREVIOUSMONTH(Calendrier[Date]))))

TEST_3MONTH = var a=SUM(TEST[Prix])
return IF(a<>BLANK(),DIVIDE(SUM(TEST[Prix])-CALCULATE(SUM(TEST[Prix]),PREVIOUSQUARTER(Calendrier[Date])),CALCULATE(SUM(TEST[Prix]),PREVIOUSQUARTER(Calendrier[Date]))))

vxinruzhumsft_0-1684725341718.png

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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