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.
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 ?
Solved! Go to 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:
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!
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:
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.
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:
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!
Hello,
I got this measure for you :
Target exercice for current month =
DIVIDE( DAY(TODAY()),DAY(EOMONTH(TODAY(),0)) )
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
56 | |
27 | |
24 | |
14 | |
9 |
User | Count |
---|---|
77 | |
61 | |
47 | |
17 | |
12 |