The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have table with below columns with like this
2018 Year-End Marker | 2019 Year-End Marker | 2020 Year-End Marker |
HM | MM | MH |
MM | HM | MM |
HM | MH | HM |
HM | MM | MM |
ML | LL | LM |
MM | LH | MM |
MH | HH | MH |
And I have date slicer with Years 2021, 2020 and 2019. I need to calculate If I select year 2021, I need to get the count of c(HH,HM,MH) in 2020 Yearend Marker and If I select year 2020, I need to get the count of c(HH,HM,MH) in 2019 Year end Marker.
I used this following expression and its not working.
Solved! Go to Solution.
Hi @Anonymous
Use the below measure:
Hi @Anonymous
Hear is the sample file with the solution https://www.dropbox.com/t/Iw44tUGijEnBmA1z
The best approach is to have your data arranged in a proper way. You need to unpivot your data into only two columns (one for the year and one for the year end marker). This is simple just follow below steps
Once the data is ready the rest is simple. First set your relationship as follows:
Then write your measure
Promotions =
CALCULATE (
COUNTROWS (
FILTER (
EmployeeMaster,
EmployeeMaster[Year-End Marker] IN { "HH", "HM", "MH" }
)
),
Dim_Date[Year] = MAX ( Dim_Date[Year] ) - 1
)
finally build your report where you can slice by Dim_Date[Year]
Hi @Anonymous
Use the below measure:
User | Count |
---|---|
24 | |
10 | |
8 | |
7 | |
6 |
User | Count |
---|---|
31 | |
12 | |
10 | |
10 | |
9 |