Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi,
I had one field which has two category values and I split them by custum method. Example below
Old Field New Field (Fruits) New Field(Vegetables)
Apple Apple Brinjal
Orange Orange Tommoto
Brinjal
Tommoto
Here my question is I need bar chart with single Dimenstion.
If I select fruits, it should show frutis as Dimenstion. or If I select Vegetables it should show Vegetalbles as Dimenstion.
My tried below Dax but it is not working.
New_Dim = if(SelectedValue(New Field(Vegetables))>0, New Field(Vegetables), New Field (Fruits) )
Solved! Go to Solution.
Hi @Anonymous ,
Here are the steps you can follow:
1. Create measure.
Measure =
if(SelectedValue('Table'[New Field(Vegetables)])<>BLANK(), MAX('Table'[New Field(Vegetables)]), MAX('Table'[New Field(Fruits)]) )2. Place [New Field(Vegetables)] in the slice, and place [Old Field] in the table
3. Result:
When a null value is selected, [New Field(Fruits)] is displayed:
When the field in [New Field(Vegetables)] is selected, the corresponding data is displayed
You can downloaded PBIX file from here.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Here are the steps you can follow:
1. Create measure.
Measure =
if(SelectedValue('Table'[New Field(Vegetables)])<>BLANK(), MAX('Table'[New Field(Vegetables)]), MAX('Table'[New Field(Fruits)]) )2. Place [New Field(Vegetables)] in the slice, and place [Old Field] in the table
3. Result:
When a null value is selected, [New Field(Fruits)] is displayed:
When the field in [New Field(Vegetables)] is selected, the corresponding data is displayed
You can downloaded PBIX file from here.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous
Watch This Video
https://www.youtube.com/watch?v=_U2M0Hkotl4&list=PLWQB3PEUJKRneu8fam5CaCMCdrIdT_zDD&index=3
Watch from 10:43 onwards to know what you asked here!
In the next video there are much more details!
Let me know if this helps!
Proud to be a Super User!
@Anonymous , I think a better idea would be a having a column and use that as filter
Type = if([col] in {"Apple","Orange"} , "Fruits","Vegetables")
Hi,
I get error. I created new column.
@Anonymous , syntax problem
Type = if([col] in {"Apple","Orange"} //condition
, "Fruits" //then value , only one
,"Vegetables" //else value only 1
)
You can also try switch : https://www.youtube.com/watch?v=gelJWktlR80
Hi,
Thanks for the reply so far, I see that slicers are working as expected but now in chart I see the values (Fruits & Vegetables). I only wanted to see default by fruits. Else On select Vegetable Slicer should show Vegetable categories as dimenstions.
Please help me on this. Thanks!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.