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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
kevint13
Regular Visitor

Create a dynamic label with dates

Hello everyone,
I'm desperately trying to create a column or measure that will serve as a label for a histogram.

 

The idea is that when I select a date in my segment, the number of matching items turns dark blue in the histogram. I managed to do it over the last month with the following formula:

Mois en cours = IF(MONTH(Fusionner1[Dateévénement])=AVERAGE('Mois analyse'[N°mois]);"Mois en cours";"Mois antérieurs")

kevint13_0-1600184078878.png

 

 

If I go back in the history it no longer works ... :

 

 

kevint13_1-1600184171275.png

 

You have an idea ?

 

PS : All data is in the same table :

Date = date fields to be taken into account in the segment

NB arrêt = data value

Unité = Axe X

kevint13_2-1600184394603.png

 

3 REPLIES 3
Anonymous
Not applicable

Hi @kevint13,

It sounds like you want to create a dynamic calculated column that used on the legend to mark the current data and previous records based on filters.

AFAIK, current power bi not able to create a dynamic column/table that responded with filter effect. (filter/slicer are worked on the virtual tables generated from data model tables, they not able to affect their parents)

In my opinion, I'd like to suggest you create a calculate table with legend categories(current month, last month) and use it on your chart. Then you can write a measure formula to extract the selection from the slicer/filter to show different results based on the current legend category.

If you confused about the coding formula, please share some dummy data to test coding formulas and design visuals.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Greg_Deckler
Community Champion
Community Champion

@kevint13 Not 100% sure of what you want. Maybe this? https://community.powerbi.com/t5/Quick-Measures-Gallery/The-Most-Amazing-Mind-Blowing-Dynamic-Slicer...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thank you for returning, I want to have the history of the values of a histogram and create a label for the values of the current month. With the particularity that when I change the date segment the label is updated to the current new month

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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