Forum Discussion
Reset Counter
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.
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.
1 Reply
- v-jianboli-msftCommunity Support
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.