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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Dynamic data labeling in time axis - display of today's costs and those of the last day of the month

Hello everyone,

 

we have a problem with the display of data labels. Our goal is to display a cumulative cost representation on a timeline. In addition, we want to use data labels to display the costs of the current date and those of the last day of the year. - Similar to the following example :

 

Jule2000_0-1707227981598.png

 

We have used the following two approaches, among others, for this - both of which do not work properly:

 

 

1. First, we enabled a custom date label under Data Labels - Values - and inserted the following measure:

 

GesamtkostenKum =
if([GesamtkostenKum]=CALCULATE([GesamtkostenKum], 'DimDatum'[Monatsname] IN {"Jan"}),
format(CALCULATE([GesamtkostenKum], 'DimDatum'[Monatsname] IN {"Jan"})/1000000,"#,# €"),
if([GesamtkostenKum]=CALCULATE([GesamtkostenKum], 'DimDatum'[Monatsname] IN {"Dez"}),
format(CALCULATE([GesamtkostenKum], 'DimDatum'[Monatsname] IN {"Dez"})/1000000,"#,# €")))
 
GesamtkostenKum - is a measure summing up all relevant costs for a specific day
DimDatum - is a date table


Here, however, only the monthly search works, but not the desired daily breakdown/search by 2 specific days (Today and Dec 31, 2024), like the following:

 

GesamtkostenKum =
IF(
    [GesamtkostenKum] = CALCULATE([GesamtkostenKum], 'DimDatum'[Datum] = TODAY()),
    FORMAT(CALCULATE([GesamtkostenKum], 'DimDatum'[Datum] = TODAY()) / 1000000, "#,# €"),
    IF(
        [GesamtkostenKum] = CALCULATE([GesamtkostenKum], 'DimDatum'[Monatsname] IN {"Dez"} && 'DimDatum'[Tag] = 31),
        FORMAT(CALCULATE([GesamtkostenKum], 'DimDatum'[Monatsname] IN {"Dez"} && 'DimDatum'[Tag] = 31) / 1000000, "#,# €"),
        BLANK()
    )
)

 

2. The second approach is as follows:
First, we added another column to the date table (DimDate) that puts an "X" in any rows we desire (eg: 

Datenbeschriftung = if('DimDatum'[Datum] = DATE(2024, 12, 31) || 'DimDatum'[Datum] = DATE(2024, 01, 01) , "X"))

- which works.


Now a measure was created that colors the data label dark if there is an X in the row and makes the data label transparent if there is no X:

 

Datenbeschriftung color =
if(SELECTEDVALUE(DimDatum[Datenbeschriftung]) = "X",
"HSLA(360, 0% , 0% , 1 )", "HSLA(360, 0% , 0% , 0)")
 
and for Values in Data Labels the color formatting was set to the above measure.

- However, it is only displayed in the graph when putting the "X" for Jan 1, 2024 and Dec 31, 2024.

 

We have tried both approaches with different cost data (not just with the measure GesamtkostenKum)

- but the same problem remains: With the first approach only the search by month works and with the second approach you can only display January 1 and December 31, 2024.

 

If you have any suggestions for our current approaches or could guide us to a different solution we would be very grateful! Thank you a lot in advance 🙂

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,
According to your description, I can understand the results you want to achieve, but for the establishment of your MEASUREMENT, we need more data and relationships for testing, please provide detailed data, table relationships, or pbix files, please hide sensitive information in advance.

Best regards

Albert He

 

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

Anonymous
Not applicable

Hi @Anonymous, 

 

It is quite difficult to upload data here, therefore I will include a test data in the chat and describe the rest of the steps I took for solution aooroach 2 here:

 

The additional column in the Table Test is created with the DAX code:

Datenbeschriftung = if('Tabelle Test'[Date] = DATE(2024, 01, 01) || 'Tabelle Test'[Date] = DATE(2024, 02, 06) , "X")
 
Then the DAX for the measure controlling the color of the data labels:
Datenbeschriftung color =
 if(SELECTEDVALUE('Tabelle Test'[Datenbeschriftung]) = "X",
"HSLA(360, 0% , 0% , 1 )", "HSLA(360, 0% , 0% , 0)")
 
Afterwards through the activation of data labels - value - color - and "fx" the color is set by a fieldvalue - which is set to the measure "Datenbeschriftung color". This works for the first and last date but not for the rest.
 
The test data is the following:
 
 
DateValueRunning Total
01.01.2024310,06946310,06946
02.01.2024609,048144919,117604
03.01.2024200,2712231119,38883
04.01.2024349,3842321468,77306
05.01.202441,27229261510,04535
06.01.2024814,4686732324,51402
07.01.2024377,8601342702,37416
08.01.2024812,8898243515,26398
09.01.2024343,93233859,19628
10.01.2024715,6255124574,82179
11.01.2024635,3171435210,13894
12.01.2024181,2202465391,35918
13.01.2024239,489555630,84873
14.01.2024813,8130796444,66181
15.01.2024521,7908036966,45261
16.01.2024382,2237677348,67638
17.01.2024681,1903838029,86676
18.01.2024148,973168178,83992
19.01.202452,6048318231,44476
20.01.202490,6422538322,08701
21.01.2024794,1631499116,25016
22.01.2024627,2254689743,47563
23.01.2024939,59098810683,0666
24.01.2024186,88186710869,9485
25.01.202446,190230510916,1387
26.01.2024480,16069411396,2994
27.01.2024723,27699712119,5764
28.01.202453,72936912173,3058
29.01.202422,392462312195,6982
30.01.2024901,58673913097,285
31.01.2024514,26324413611,5482
01.02.2024487,63242214099,1806

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors