Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
I have the following data:
table: fact_table
year | week | id | value | |||
2023 | w1 | E01 | 163 | |||
2023 | w1 | E02 | 35 | |||
2023 | w1 | E03 | 123 | |||
2023 | w1 | E04 | 8 | |||
2023 | w1 | E06 | 177 | |||
2023 | w1 | E07 | 38 | |||
2023 | w2 | E01 | 103 | |||
2023 | w2 | E02 | 180 | |||
2023 | w2 | E03 | 31 | |||
2023 | w2 | E04 | 57 | |||
2023 | w2 | E06 | 88 | |||
2023 | w2 | E07 | 179 | |||
2023 | w2 | E08 | 69 | |||
2023 | w3 | E02 | 177 | |||
2023 | w3 | E03 | 176 | |||
2023 | w3 | E04 | 62 | |||
2023 | w3 | E06 | 92 | |||
2023 | w3 | E07 | 163 | |||
2023 | w4 | E01 | 160 | |||
2023 | w4 | E02 | 73 | |||
2023 | w4 | E03 | 38 | |||
2023 | w4 | E04 | 47 | |||
2023 | w4 | E06 | 64 | |||
2023 | w4 | E07 | 152 | |||
2023 | w4 | E08 | 129 | |||
2024 | w1 | E02 | 63 | |||
2024 | w1 | E03 | 111 | |||
2024 | w1 | E04 | 44 | |||
2024 | w1 | E06 | 45 | |||
2024 | w1 | E07 | 175 | |||
2024 | w2 | E01 | 75 | |||
2024 | w2 | E02 | 154 | |||
2024 | w2 | E03 | 60 | |||
2024 | w2 | E04 | 21 | |||
2024 | w2 | E06 | 57 | |||
2024 | w2 | E07 | 153 | |||
2024 | w2 | E08 | 175 | |||
2024 | w3 | E02 | 94 | |||
2024 | w3 | E03 | 172 | |||
2024 | w3 | E04 | 75 | |||
2024 | w3 | E06 | 101 | |||
2024 | w3 | E07 | 99 | |||
2024 | w4 | E01 | 145 |
and table id:
id
E01
E02
...
E10
and I want to calculate the frequency of Top 3 value of each week of each id in each, for example,
in year 2023, in week w1, Top 3 is: E06,E01,E03
in week w1, Top 3 is:E02,E07,E01
in week w1, Top 3 is:E02,E03,E07
in week w1, Top 3 is:E01,E07,E08
so week top3 frequency of E01 is 3,
that of E02 is 1,
that of E03 is 2,
that of E04 is 0,
........
do you know how to caluculate it in DAX with high performance? Thank you.
Solved! Go to Solution.
Hello @oakfootballclub
please check if this accomodate your need (not sure if this DAX with high performace).
1. Create rank or index based on 'value' column in fact_table so you can easily find top 3.
4. in table ID, create measure to count frequency of top 3 ID
Hello @oakfootballclub
please check if this accomodate your need (not sure if this DAX with high performace).
1. Create rank or index based on 'value' column in fact_table so you can easily find top 3.
4. in table ID, create measure to count frequency of top 3 ID
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
16 | |
10 | |
8 | |
8 | |
7 |