Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
I have a Fact Table with the Names and the Target Table with the Target and Default Target.
I want to consider the Names from Fact Table and the Targets from the Target Table, where the names that are not listed in the Target Table should be assigned a default value "100%".
Is there a way to achieve this?
Attached a sample .pbix file (Targets.pbix) for better understanding.
Thanks in Advance!
Solved! Go to Solution.
Final Target = VAR __var = IF(Fact[Names] = RELATED('Target Table'[Name]),RELATED('Target Table'[Target]), RELATED('Target Table'[Default Target]))
RETURN IF(ISBLANK(__var),1,__var)
You could do something like:
Final Target 1 = VAR __var = IF(Fact[Names] = RELATED('Target Table'[Name]),RELATED('Target Table'[Target]), RELATED('Target Table'[Default Target]))
RETURN IF(ISBLANK(__var),MAXX(ALL('Target Table'),[Default Target]),__var)
Final Target = VAR __var = IF(Fact[Names] = RELATED('Target Table'[Name]),RELATED('Target Table'[Target]), RELATED('Target Table'[Default Target]))
RETURN IF(ISBLANK(__var),1,__var)
I have a followup question. Is there any chance to use the Default target column instead of hard coding the default value?
You could do something like:
Final Target 1 = VAR __var = IF(Fact[Names] = RELATED('Target Table'[Name]),RELATED('Target Table'[Target]), RELATED('Target Table'[Default Target]))
RETURN IF(ISBLANK(__var),MAXX(ALL('Target Table'),[Default Target]),__var)
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 52 | |
| 33 | |
| 32 | |
| 18 | |
| 18 |
| User | Count |
|---|---|
| 67 | |
| 67 | |
| 44 | |
| 28 | |
| 25 |