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! Request now
Hi,
I am an entry level powerBI developer and am trying to simplify this measure using variables. I have never done this with an IF statement. Any help/suggestions would be much appreciated.
Hi @TechoGirl0 ,
Do you mean something like this? 🙂
VAR _v1 =
CALCULATE (
DISTINCTCOUNT ( Program[ProgramStoreProduct] ),
FILTER ( Program, Program[Non Compliant] = 1 )
)
RETURN
IF ( _v1 = BLANK(), BLANK(), _v1 )
Let me know if this helps 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
| Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
| Also happily accepting Kudos 🙂 |
| Feel free to connect with me on LinkedIn! | |
| #proudtobeasuperuser | |
No need for any variables for the above formula. And the simplest (and fastest) version is this:
calculate (
distinctcount ( Program[ProgramStoreProduct] ),
keepfilters ( Program[Non Compliant] = 1 )
)
By the way, this expression:
IF ( _v1 = BLANK(), BLANK(), _v1 )
is nothing else but simply...
_v1
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 24 | |
| 21 | |
| 11 | |
| 10 | |
| 8 |