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 a report where I have 3 tables, the tables are lined up side by side.
Each table only shows results for the corresponding number. Table 1 = Number 1, etc.
Each table has a name and a picture
Table 1 | Table 1 | Table 2 | Table 2 | Table 3 | Table 3 | ||
In the table
Name | Img | Number |
John | image1.jpg | 1 |
Joe | image2.jpg | 2 |
Sam | image3.jpg | 3 |
Jake | image4.jpg | 1 |
Michelle | image5.jpg | 2 |
In sql I can do row number and have it restart number at 3. But the numbers don't update when you filter in powerbi.
I need to do the same thing in powerbi so that it is dynamic. So if I filter on location it removes the users and updates the number.
I feel like this should be something simple but I am not having any luck.
Solved! Go to Solution.
Hi @tgraves ,
Please try:
First unpivot the table:
Then use this table to create a slicer
Apply the measrue:
Number =
var _a = LEFT(MAX('Table (2)'[Img]),LEN(MAX('Table (2)'[Img]))-4)
var _b = RIGHT(_a,LEN(_a)-5)
var _c = COUNTROWS('Table (3)')
var _d = MOD(_b,_c)
return IF(_d=0,_c,MOD(_b,_c))
Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @tgraves ,
Please try:
First unpivot the table:
Then use this table to create a slicer
Apply the measrue:
Number =
var _a = LEFT(MAX('Table (2)'[Img]),LEN(MAX('Table (2)'[Img]))-4)
var _b = RIGHT(_a,LEN(_a)-5)
var _c = COUNTROWS('Table (3)')
var _d = MOD(_b,_c)
return IF(_d=0,_c,MOD(_b,_c))
Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
24 | |
10 | |
8 | |
7 | |
6 |
User | Count |
---|---|
32 | |
12 | |
10 | |
10 | |
9 |