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.
Hi,
I have a table which shows me the working years for a certain year and month.
Now i want to filter this table by month so it shows me only the working anniversaries 5,10,15,20,25,30,35,40
But only the month when it occurs, not the following months.
Is this possible?
My Measures:
Sub Measure:
Dienstjaren1:=VAR SelectedDate =MAX(Datumtabel[Date])
VAR CurrentEmployee = MAX(Medewerkers[Datum in dienst basis])
VAR YearDiff = YEAR(SelectedDate) - YEAR(CurrentEmployee)
RETURN
IF ( MONTH(SelectedDate) > MONTH(CurrentEmployee);
YearDiff;
IF (MONTH(SelectedDate) = MONTH(CurrentEmployee) && DAY(SelectedDate) >= DAY(CurrentEmployee);
YearDiff;
YearDiff-1
)
)
End Measure:
Dienstjaren2:=VAR MaxDate=MAX(Datumtabel[Date])
VAR MaxYear=year(MaxDate)
Return
CALCULATE(AVERAGEX(Medewerkers;[Dienstjaren1]);
Medewerkers[Datum in dienst]<=MaxDate;
OR(Medewerkers[Datum uit dienst]>MaxDate;
ISBLANK(Medewerkers[Datum uit dienst]));
Medewerkers[Functie]<>"Commissaris")
That test file seems to connect to a cube/data model?
Yes, my basis was a Power Pivot model. I moved this now to PBI.
Here is the PBIX file. Thank you in advance!
This is a bit trickier than it seemed because you have to treat month 1 separately.
bgcolor =
var a = SELECTEDVALUE(Datumtabel[Month])
var b = CALCULATETABLE(summarize(Datumtabel,[Month],"cy",[Dienstjaren c]),REMOVEFILTERS(Datumtabel[Month]))
var c = minx(filter(b,[cy] in {5,20}),[Month])
var d = sumx(b,[cy])
return if(a=c,if(a>1,"lightgreen",if(d in {60,240},"lightgreen")))
You are the best!
Thank you very much!
Kind regards
Marcel
Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.
https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
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 |
---|---|
96 | |
95 | |
82 | |
71 | |
64 |
User | Count |
---|---|
116 | |
106 | |
94 | |
79 | |
72 |