The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi everyone!
I would like you to help me with this problem. I have slicers for plant, tipo_mov, year and week.
the filter of week is based on a column created like this:
and I have created two tables, the first table:
and I also want to create another table with one column more (the days of the week). I would like to get the same result in the rank as the first table for each product. I mean, i would like to calculate the rank excluding day_desc dimension, maintaining the same rank like this:
I have this formula and almost I got the same result of rank for each product in both tables, but something is wrong because it does not work at all...
RANKX(
CALCULATETABLE( VALUES('DIM_MARCA'[Product]),
ALLSELECTED('DIM_MARCA') ),
CALCULATE( SUM(fact_movimientos_turnos[Amount]),
ALLEXCEPT( f
act_movimientos_turnos,
'FACT_MOVIMIENTOS_TURNOS'[TIPO_MOV],
'DIM_MARCA'[Marca], 'DIM_ARTICULO'[Planta],
'DIM_TIEMPO'[year],
'DIM_TIEMPO'[week] ),
ALL('DIM_TIEMPO'[Day_DESC]) ) )
the result is the following:
Something I am doing wrong because Product C, according table1, shoul have rank 3, not 4. I hope I have explained myself well.
Please, could you help me.
Thank you so much!
Ruth
@RuthMerchán , On the best way to deal with such think to have separate date and product table.
This should work
RANKX(
allselected VALUES('DIM_MARCA'[Product]),
CALCULATE( SUM(fact_movimientos_turnos[Amount])),,desc,dense)
it says syntax error: The syntax of 'VALUES' is not correct (DAX(RANKX(allselected VALUES('DIM_MARCA'[Product]),CALCULATE( SUM(fact_movimientos_turnos[Amount])),,desc,dense).
I am interesting in having days of the week too, because I want to make a line graph with x axis (days of the week), y axis (amount) and legend (products). As I am working with a parameter thar shows this graph according products or categories, This formula is the base of what I would like to do. The goal is to put this rank_measure in filters and select to show equal or lower than 10 rank. This is the way I think I can get a top N whith a parameter of this type, as I can not put two fields for make TOPN in the same visualization (in this case topn for product and topn for category).
First, this formula has to work so that I can use it in another formula taking into account the parameter, and it does not work as I expected.
The rank for each product or category shoud be the same as table 1 (example) and it is being different...
Maybe, getting this functionality is not possible...
User | Count |
---|---|
74 | |
70 | |
39 | |
30 | |
28 |
User | Count |
---|---|
104 | |
95 | |
51 | |
48 | |
46 |