Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi All,
I want to copy the week values which isn't blank to the other blank weeks. In the example attached the last week with value is week 25. I want copy this values to all other weeks in the future without value in column E. This new formula should replace column F.
Solved! Go to Solution.
thanks for your reply @BYENER
2 methods:
you can use function switch() to replace each row https://docs.microsoft.com/en-us/dax/switch-function-dax
replace =
var _baseweek="2021-25"
var _avg2=CALCULATE([averageMeasure],FILTER(ALL('Table'),'Table'[N]=2&&'Table'[Week]=_baseweek))
var _avg3=CALCULATE([averageMeasure],FILTER(ALL('Table'),'Table'[N]=3&&'Table'[Week]=_baseweek))
var _avg4=CALCULATE([averageMeasure],FILTER(ALL('Table'),'Table'[N]=4&&'Table'[Week]=_baseweek))
var _avg5=CALCULATE([averageMeasure],FILTER(ALL('Table'),'Table'[N]=5&&'Table'[Week]=_baseweek))
var _avg6=CALCULATE([averageMeasure],FILTER(ALL('Table'),'Table'[N]=6&&'Table'[Week]=_baseweek))
return IF(MIN('Table'[Week])=_baseweek,[averageMeasure],SWITCH(MIN('Table'[N]),2,_avg2,3,_avg3,4,_avg4,5,_avg5,6,_avg6))
result:
or replace measure with column.
Best Regards,
Community Support Team _ Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi @BYENER
you can use add column in PQ editor, e.g.
Best Regards,
Community Support Team _ Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-xiaotang ,
The data in Power BI is not in a table view. It's calculated by a measure (Average %)
Hi @BYENER
Have you solved your problem? If yes, kindly mark the answer helpful as the solution, so that the others having same question can find this post quickly.
or
if problem still persists, pls let me know.
Best Regards,
Community Support Team _ Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
thanks for your reply @BYENER
2 methods:
you can use function switch() to replace each row https://docs.microsoft.com/en-us/dax/switch-function-dax
replace =
var _baseweek="2021-25"
var _avg2=CALCULATE([averageMeasure],FILTER(ALL('Table'),'Table'[N]=2&&'Table'[Week]=_baseweek))
var _avg3=CALCULATE([averageMeasure],FILTER(ALL('Table'),'Table'[N]=3&&'Table'[Week]=_baseweek))
var _avg4=CALCULATE([averageMeasure],FILTER(ALL('Table'),'Table'[N]=4&&'Table'[Week]=_baseweek))
var _avg5=CALCULATE([averageMeasure],FILTER(ALL('Table'),'Table'[N]=5&&'Table'[Week]=_baseweek))
var _avg6=CALCULATE([averageMeasure],FILTER(ALL('Table'),'Table'[N]=6&&'Table'[Week]=_baseweek))
return IF(MIN('Table'[Week])=_baseweek,[averageMeasure],SWITCH(MIN('Table'[N]),2,_avg2,3,_avg3,4,_avg4,5,_avg5,6,_avg6))
result:
or replace measure with column.
Best Regards,
Community Support Team _ Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 48 | |
| 46 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 70 | |
| 67 | |
| 32 | |
| 27 | |
| 26 |