Forum Discussion
Help with DAX
- 1 year ago
Hi rod_puente
The purpose of using two slicers is unclear to me, but you can follow these steps:
1. create three tables for matrix and those two slicer ( you can write sth like summarize(your_table, year) to make it dynamic or just write 2023 and 2024 ) . keep in mind these three tables should not have any relationship with other tables.
2. use one of these tables (table1) in slicer1, table2 in slicer2 and table3 in the matrix
3. write a measure as follows:
measure amount := if ( selectedvalue ( table3 [year]) =selectedvalue (table1 [year]) , calculate (sum(amount), filter (your_table , year= selectedvalue (table1 [year]) , if (selectedvalue ( table3 [year]) =selectedvalue (table2 [year]) , calculate (sum(amount), filter (your_table , year= selectedvalue (table2 [year]) )
Your requirement is a bit unconventional, but I'm happy to assist. Could you provide more details on the rationale behind using two slicers? This approach seems complex, and I'm wondering if there's a specific reason you're choosing this method.
If this post helps, then I would appreciate a thumbs up 👍 and mark it as the solution to help the other members find it more quickly.
Hi rod_puente
for Amount: 2024 , try to use All(year2) in your calculation , similarly , for amount 2023, try All(year1)
also it would be helpful if you can share power bi file along with sample data and what you are trying to acheive