Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have a Table as shown below:
From the table I created a table visual with Product slicer.
The movement is the difference in Average of Cost and Average of Base Price.
The requirement is that whenever I select product in a slicer, it should display the movement on and after the base Month. For example, if i select product A from the slicer, the table visual will display
and if I select product B, then it will display
and so on when other products are selected.
Hence, if no product is selected then it show default to it normal table visual where all movement displays.
How can i achieve this?
Solved! Go to Solution.
Hi @Anonymous ,
Please try the following measure:
Movement =
CALCULATE (
AVERAGE ( 'Table'[Cost] ) - AVERAGE ( 'Table'[Base Price] ),
FILTER ( 'Table', 'Table'[Month] >= 'Table'[Base Month] )
)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , Create measure like
[Avg of Cost] - calculate([Avg of Cost] , filter(allselected(Table[Month]), Table[Month] <= Max(Table[Month])))
or
[Avg of Cost] - calculate([Avg of Cost] , filter(allselected(Table), Table[Month] <= Max(Table[Month])))
[Avg of Cost] - calculate(averageX(Table[Month],[Avg of Cost]) , filter(allselected(Table), Table[Month] <= Max(Table[Month])))
Assume [Avg of Cost] is a measure
Hi amitchandak,
Thanks for the dax. I have rewritten your dax to work.
[Avg of Cost] = CALCULATE([Avg of Cost], FILTER(ALLSELECTED(Table), Table[Month] >= MAX(Table[BaseMonth])))
This works fine. However, when no Product or all Products is selected on the slicer, then it should display all movement. for example as shown below when no product is selected
Hi @Anonymous ,
Please try the following measure:
Movement =
CALCULATE (
AVERAGE ( 'Table'[Cost] ) - AVERAGE ( 'Table'[Base Price] ),
FILTER ( 'Table', 'Table'[Month] >= 'Table'[Base Month] )
)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi amitchandak, the dax is not working. I don't know if it is because it doesn't have baseMonth in the dax.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |