March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I got this DAX formula to highlight dots in a scatter plot using 1 og 0 in conditional formatting.
It works great, except when I use the field parameter slicer to choose multiple filters
Can anyone please help me correct my DAX, so it works as good as my counter DAX formula and dosent highlight any dot when the counter is 0
Solved! Go to Solution.
Measure:
Highlight Valgte Muligheder =
VAR Opslag = VALUES('Highlight indhold'[Valgmuligheder]) -- Captures all currently selected values
VAR Business_Cases = IF(CONTAINS(Opslag, 'Highlight indhold'[Valgmuligheder], MAX(HighligtGBS[HL - Business Cases])), 1, 0)
VAR Storbageri = IF(CONTAINS(Opslag, 'Highlight indhold'[Valgmuligheder], MAX(HighligtGBS[HL - Storbageri])), 1, 0)
VAR Bageri = IF(CONTAINS(Opslag, 'Highlight indhold'[Valgmuligheder], MAX(HighligtGBS[HL - Bageri])), 1, 0)
VAR Resultat = Business_Cases + Storbageri + Bageri
VAR MultiResultat = IF(Resultat > 0, 1, 0) -- Assign 1 if at least one condition is met
RETURN
IF(
HASONEFILTER('Highlight indhold'[Valgmuligheder]),
Resultat,
IF(ISCROSSFILTERED('Highlight indhold'[Valgmuligheder]), MultiResultat, BLANK())
)
Let me know if this resolves the issue!
If this helped, a Kudos 👍 or Solution mark would be great!
Cheers,
Kedar Pande
Hi Again Kedar_Pande
I thing i found the issue. It is because I have a colomn with three different department for each ID in the same tabel where I check for my Field Parameter such as "Business Cases" and "Storbageri" etc.
The department is in a slicer, and when I select one department everything in your DAX formula works great !
Could you please tell have to add to your DAX if all departments are selected in the slicer it return 0.
So if there is non selected in the department slicer the measure should only give 1 to the ID's that have multiselected (F.eks. Business Cases and Storbageri) in the same department under each ID ?
I really hope you can help me, because you are so close to the answer 🙂
Is there anyone who can please solve this issue ?
If I could take the counter in as a parameter in my main DAX it would solve the problem, but I am getting a circular reference fail - probely because of the countX formula in the counter DAX formula and maybe the fact that I use my main formula "Highlight Valgte Muligheder" in the statement:
Highlighted butikker =
COUNTX(HighligtGBS, IF([Highlight Valgte Muligheder] > 0, 1))-0
But If I simple could change this part in my main formula:
...
RETURN
IF(HASONEFILTER('Highlight indhold'[Valgmuligheder]), Resultat, IF(ISCROSSFILTERED('Highlight indhold'[Valgmuligheder]), MultiResultat, BLANK()))
to this:
...
RETURN
IF(HASONEFILTER('Highlight indhold'[Valgmuligheder]), Resultat, IF(ISCROSSFILTERED('Highlight indhold'[Valgmuligheder] && [Highlighted butikker] > 0), MultiResultat, BLANK()))
then it would solve the problem.
The counter is always right.
The fail in my main formula is that it highlights (gives 1 to) the ID's that only have one of the two selected in the slicer. So if I select "Bageri" and "Business Cases" there are 4 ID's that have one of the two, and therefore it highligths it in the graph, but I could only be the ID's how have both "Bageri" and "Business Cases" - as the counter formula tells.
Hopes this helps someone to see a solution for me, please
Hi @DK-C-87 ,
Yes, I did try to reproduce what you stated.
But I realized that I am not able to know exactly what form your table data is in.
Or if you can provide me with the data from the 'Highlight indhold' form and the 'HighligtGBS' form.
Please provide relevant example data and specific .pbix files if you can.
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Yilong Zhou
I have made a example .pbix file os the data, but somehow I can't see where to upload it in my reply to you. - do you know how to upload a file in here ?
When I was making the example file for you it came to me that I have a slicer that filters on three types of departments. And the issue with the formula and the dots that needs to be or not be hightlighted occurs when there is no selections in the department slicer.
So somehow I think I have to add this to the formula, so if there is no selected department in the slicer then all should be blank ()
- If you get what I mean by this, maybe you could help with that ?
Hi @DK-C-87 ,
For some new community members, they don't have the permission to upload .pbix files. You may need to share file links via DropBox, One Drive, Drive or any other tool.
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Measure:
Highlight Valgte Muligheder =
VAR Opslag = VALUES('Highlight indhold'[Valgmuligheder]) -- Captures all currently selected values
VAR Business_Cases = IF(CONTAINS(Opslag, 'Highlight indhold'[Valgmuligheder], MAX(HighligtGBS[HL - Business Cases])), 1, 0)
VAR Storbageri = IF(CONTAINS(Opslag, 'Highlight indhold'[Valgmuligheder], MAX(HighligtGBS[HL - Storbageri])), 1, 0)
VAR Bageri = IF(CONTAINS(Opslag, 'Highlight indhold'[Valgmuligheder], MAX(HighligtGBS[HL - Bageri])), 1, 0)
VAR Resultat = Business_Cases + Storbageri + Bageri
VAR MultiResultat = IF(Resultat > 0, 1, 0) -- Assign 1 if at least one condition is met
RETURN
IF(
HASONEFILTER('Highlight indhold'[Valgmuligheder]),
Resultat,
IF(ISCROSSFILTERED('Highlight indhold'[Valgmuligheder]), MultiResultat, BLANK())
)
Let me know if this resolves the issue!
If this helped, a Kudos 👍 or Solution mark would be great!
Cheers,
Kedar Pande
Hi Again Kedar_Pande
I thing i found the issue. It is because I have a colomn with three different department for each ID in the same tabel where I check for my Field Parameter such as "Business Cases" and "Storbageri" etc.
The department is in a slicer, and when I select one department everything in your DAX formula works great !
Could you please tell have to add to your DAX if all departments are selected in the slicer it return 0.
So if there is non selected in the department slicer the measure should only give 1 to the ID's that have multiselected (F.eks. Business Cases and Storbageri) in the same department under each ID ?
I really hope you can help me, because you are so close to the answer 🙂
When I select "Business Cases" and "Bageri" it highlights 25 dots in stead of 4 - and the counter in the buttom left corner also counts 25 dots. But the real answer is 0 dots.
If I change the Variable:
VAR MultiResultat = IF(Resultat > 0, 1, 0) -- Assign 1 if at least one condition is met
To
VAR MultiResultat = IF(Resultat > 1, 1, 0) -- Assign 1 if at least one condition is met
It highlights 4 dots in the scatter plot and count 0 (the correct answer) in the buttom left corner. In other words, it sends me right back to where I started.
I hope this maybe helps you to see a new solution ?
I need it to highlight 0 dots, same as the counter, because der is non of the ID's that have both "Bageri" and "Business Cases" - hope this clarifies it
I have been struggling with this for 2 weeks know 🙂
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
89 | |
84 | |
70 | |
51 |
User | Count |
---|---|
206 | |
146 | |
97 | |
79 | |
69 |