Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have two tables
Date | MTD | QTD | YTD
second table is
Selection
MTD
QTD
YTD
slicer hav the values of second table
is there any other way than using if to have sum of MTD column of first table when MTD is selected etc?
Solved! Go to Solution.
Cool,
Try this it will help u, if not let me know.
Note :
If u select multiple option it will move to Others part.
Cool,
Try this it will help u, if not let me know.
Note :
If u select multiple option it will move to Others part.
Cool @Baskar! So you create a var in order to avoid writing the if statement inside switch? Thanks!
Yes u r correct my friend. Var is more powerfull function in DAX.
It will help u in many situation, and good performance too.
🙂
Thanks @Baskar! Can this var used in another measure? eg
SWITCH(Filter_Value,"MTD",SUM('MTD),"QTD",SUM(QTD),"YTD",SUM(YTD),"")
No, Var only used inside the measure , we can't use outside .
Cool
think i found it
its switch...?
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
68 | |
64 | |
52 | |
39 | |
26 |
User | Count |
---|---|
80 | |
57 | |
45 | |
44 | |
35 |