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
yoa380
New Member

Monthly Progress in % as Gauge Target

Hello, I have in my Power BI report a gauge chart showing the production attainment. Let's say that today 26 march, attainment is 80%.

I would like to add a target on this gauge. A dynamic target that would show the month progression.

For today 26 march (I want the target to be 84% (as 26 march is 84% of whole march month having 31 days). We would visually see the attainment is under target.

If on my report, i select the previous month (2024 - february) of course I want to have 100% and if april selected, it would still be 0%.

 

What is the best way to do that ? i thought about an excel file for each year/month and a formula but it would mean to get inside the file everyday and update/save it for the formula to refresh. any other way with DAX ?

1 ACCEPTED SOLUTION

Hi @yoa380 ,

 

Please try to create a Measure:

 

Measure % = 
 VAR SelectedMonth = MONTH(SELECTEDVALUE('Table'[Date]))
    RETURN
        IF(SelectedMonth < MONTH(TODAY()), 1, 
            IF(SelectedMonth > MONTH(TODAY()), 0, 
                [Month Progression %]))

 

 

You should have achieved your needs now:

vhuijieymsft_0-1711702041626.png

vhuijieymsft_1-1711702054933.png
vhuijieymsft_2-1711702054934.png

 

The pbix file has been attached.

 

If you have other questions, please contact me at any time.

 

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!

View solution in original post

4 REPLIES 4
v-huijiey-msft
Community Support
Community Support

Hi @yoa380 ,

 

Thanks for the reply from @QuentinBl , please allow me to provide my insight:

 

Please create a measure:

Month Progression % = 
VAR StartMonth =
    DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 1 )
VAR EndMonth =
    eomonth ( tday (), 0 )
VAR DaysPassed = TODAY ()-StartMonth
VAR TotalDays = EndMonth-StartMonth
RETURN
    DIVIDE ( DaysPassed, TotalDays, 0 ) * 100

 

Put "Month Progression %" into the Target value of the Gauge.

 

The page result is shown below:

vhuijieymsft_0-1711522891902.png

 

The pbix file is attached.

 

If you have any other questions please feel free to contact me.

 

I would be grateful if you could provide me with sample data for testing, please remove any sensitive data in advance.

 

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!

Hello, Thanks a lot for this measure. I have now succeeded to add it as target value. On my gauge it appears well. But if I change the month in filter on my page (for example February), it would still show 87% (I want 100%) and if I select April I want 0%. Any idea of how to add IF rules in the measure you created for me ?

I have attached a picture with my gauges and my filters (year / month) from a calendar table.

 

yoa380_1-1711533656506.png

 

 

 

 

Hi @yoa380 ,

 

Please try to create a Measure:

 

Measure % = 
 VAR SelectedMonth = MONTH(SELECTEDVALUE('Table'[Date]))
    RETURN
        IF(SelectedMonth < MONTH(TODAY()), 1, 
            IF(SelectedMonth > MONTH(TODAY()), 0, 
                [Month Progression %]))

 

 

You should have achieved your needs now:

vhuijieymsft_0-1711702041626.png

vhuijieymsft_1-1711702054933.png
vhuijieymsft_2-1711702054934.png

 

The pbix file has been attached.

 

If you have other questions, please contact me at any time.

 

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!

QuentinBl
Helper I
Helper I

Hello,

I got this measure for you : 

 

Target exercice for current month =
DIVIDE( DAY(TODAY()),DAY(EOMONTH(TODAY(),0)) )

 



You can complete it with a IF statement that check if your selected month is before or after current month. If it's before, your target is 1, if it's after, your target is 0. 

I can help you more if you give me a sample of your dataset without real value.

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.